Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery each has class

 $('li').each(function (){
    if($(this).hasClass("active")){
      $(this).css("color", "red");
    }
    else{
      $(this).css("color", "blue");
    }
  });
 
PREVIOUS NEXT
Tagged: #jquery #class
ADD COMMENT
Topic
Name
7+8 =