2014-02-27 73 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">