css - Removing class Jquery -
i want remove class of .active
on $(document).ready
.
css
.active { color: "red" }
html
<div class="item step-00"> test </div> <div class="item step-0 active"> test1 </div>
jquery
$(document).ready(function() { $(".item step-0 active").removeclass("active"); $(".item step-00").addclass("active"); });
you need .
before each class this:
$(document).ready(function(){ $(".item.step-0.active").removeclass("active"); $(".item.step-00").addclass("active"); });
or simplify this:
$(document).ready(function(){ $(".item.step-0, .item.step-00").toggleclass("active"); });
edit: need enable jquery in fiddle. fiddle
Comments
Post a Comment