开发者

How add css class with Mootools

开发者 https://www.devze.com 2023-01-25 11:20 出处:网络
<div class=\"generic_layout_container layout_ride_ridespec\"> </div> How to programmicaly add an extra class or one more property with existing class to above div.
<div class="generic_layout_container layout_ride_ridespec">
</div>

How to programmicaly add an extra class or one more property with existing class to above div. I would like out put as follows

<div class="generic_layout_container layou开发者_运维百科t_ride_ridespec example_class">
</div>

Please excuse id/name solution, there is little difficulty to add an id or name for above element. Thanks


MooTools does have an addClass() method. Eg:

HTML

<div id="myElement" class="testClass"></div>

Javascript

$('myElement').addClass('newClass');
0

精彩评论

暂无评论...
验证码 换一张
取 消