【发布时间】:2016-12-21 13:12:26
【问题描述】:
所以这是使用 Css 设置颜色的方法:.select2-container--default .select2-selection--single .select2selection__placeholder {color: #444;}
但是如何使用“this”通过 Jquery 更改颜色?
$(this).css('color', 'red') 不要工作。$(this)[0].css('color', 'red') 不要工作。$(this[0]).css('color', 'red') 不要工作。
编辑
console.log($this))0:select#employment.form-control.select2.req_place
【问题讨论】:
-
你能告诉我们你尝试了什么吗?我们不知道为什么“this”不起作用,因为我们不知道“this”指的是什么。
-
@ThEBiShOp 检查编辑..