we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
showing results for - "jquery each has class"
Olivier
21 Oct 2018
1 $('li').each(function (){
2    if($(this).hasClass("active")){
3      $(this).css("color", "red");
4    }
5    else{
6      $(this).css("color", "blue");
7    }
8  });