How add css class with Mootools
<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');
精彩评论