Published
- 1 min read
jquery each has class
The solution for this is noted below
jquery each has class
Solution
$('li').each(function () {
if ($(this).hasClass('active')) {
$(this).css('color', 'red')
} else {
$(this).css('color', 'blue')
}
})
Try other methods by searching on the site. That is if this doesn’t work