【发布时间】:2013-11-21 12:40:30
【问题描述】:
如果我有这样的课程:
class="thing-1"
我要补充:
class="thing-1 thing-2"
如何使用 jQuery 做到这一点?
【问题讨论】:
-
$('.thing-1').addClass("thing-2") -
在问问题之前请先谷歌你需要..
标签: javascript jquery html
如果我有这样的课程:
class="thing-1"
我要补充:
class="thing-1 thing-2"
如何使用 jQuery 做到这一点?
【问题讨论】:
$('.thing-1').addClass("thing-2")
标签: javascript jquery html
你也可以添加多个类试试这个:-
$('.thing-1').addClass('thing-1 thing-2 thing-3');
【讨论】:
使用 .addClass :Source
$('.thing-1').addClass('thing-2')
【讨论】:
你可以用这个
.addClass('thing-2')
【讨论】:
$('.thing-1').addClass('thing-2')
【讨论】: