+1 vote
by
I want to appeal to all ul in which no classes (just got out of the editor in the admin panel) to stylize them by adding thereto any default class

if ($("ul").hasClass('')) {
$(this).addClass("active");

} else {
return;
}
Not working, and replace $("ul").addClass("active"); Adds the class to all the lists, outside of savijati they have a class or not.

2 Answers

0 votes
by
 
Best answer
$('ul:not([class])').addClass('active')
0 votes
by
1. Why, then, check, if you know that they have no classes?!
2. Is .find() and .each() - match.
...