2014-02-27 74 views
0

我一直在select2中遇到此问题。我不能表现出最初的标签,如图select2的主页:Select2初始标签

<input width="100px" type="text" id="e12"> 
<script> 
    $(document).ready(function(){ 
$("#e12").select2({multiple:'true',tags:["red", "green", "blue"]}); 
}); 
</script> 

但‘颜色’显示当且仅当我开始打字。否则,输入是空白的。

回答

1

就像热水一样简单:我忘了把值放在输入标签中!

<input width="100px" type="text" id="e12" value="pippo,italy">