select2不使用标签

Cha*_*les 2 jquery jquery-select2

尽管复制了文档中提供的代码,但我无法使用select2来处理标记.这是一个基本的jsfiddle与select2功能:http://jsfiddle.net/Gh4Ac/

现在,我在这个新的改变.例如唯一的一点是$("#e2").select2();$("#e2").select2({tags:["red", "green", "blue"]});.结果如下:http://jsfiddle.net/Gh4Ac/1/

请注意,第一个示例有效,但第二个示例不起作用.有人可以解释如何让标签为select2工作吗?

Cha*_*les 6

解决方案是使用input而不是select.见http://jsfiddle.net/Gh4Ac/2/