2016-08-13 105 views
0

我只是想在select2上的「文本」上改變一些顏色,但沒有渲染。我可以在select2的「text」屬性中添加css語法嗎?

results.push({ 
    id: item.kode_mobil, 
    text: item.tipe_mobil + " (<span style='color:red'>"+item.nomor_polisi+"</span>)", 
}); 

但它結束這樣
enter image description here

對不起,我的英語水平。 感謝

+0

使用'html'財產? – kukkuz

+0

什麼是結果?我們需要更多的背景。 – cambunctious

+0

是的,我想。或者我該怎麼做? – newbie

回答

0

您可以添加CSS

假設你選擇標籤類的名字是 '選擇'

然後

.select option 
{ 
color:red 
} 
相關問題