【发布时间】:2016-05-23 09:39:57
【问题描述】:
演示和我的代码是这样的:http://jsfiddle.net/fc1qevem/10/
我的javascript代码是这样的:
var select02 = $('#select02');
$(select02).select2({
data: [{
id: 0,
text: "test01"
}, {
id: 1,
text: "test02"
}, {
id: 2,
text: "test03"
}, {
id: 3,
text: "test04"
}, {
id: 4,
text: "test05"
}],
placeholder: "Branch name",
});
我想把select2的背景颜色改成蓝色
我想使用 javascript 更改背景颜色
能不能做到?
谢谢
【问题讨论】:
-
.select2-search 输入{ background-color: blue;在你的 CSS 中试试这个
-
@Karthikeyan,如果css可以放在javascript中?
-
$('.select2-selection').css('background-color', 'blue'); @moses t 你可以试试这个。
标签: javascript jquery html css jquery-select2