Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

jQuery - if no class exist in the element

0 votes
126 views
added Jul 17, 2018 in jQuery by LC Marshal Captain (26,090 points)
edited Jul 17, 2018 by LC Marshal
let elList = $('ul.list-unstyled.multi-steps li'),
            elActive = $(elList).hasClass('is-active');
            // elNorm = $(elList).addClass('non-active');

if(!elActive) {
  $(elList).addClass('non-active');
  console.log(0)
} else if(elActive) {
  $(elList).removeClass('non-active');
  console.log(1)
}

 

Please log in or register to response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...