Jquery: last missing multiple classes
I have an unordered list and I am using jquery to find the last ul and apply the class.
jQuery("ul.class1:last").addClass("lastUi");
html looks like this:
<ul class="class1"></ul>
<ul class="class1"></ul>
This works great, however it has now changed in that another class is added to the list, so the html looks like this:
<ul class="class1"></ul>
<ul class="class1 class2"></ul>
<ul class="class1"></ul>
<ul class="class1 class2"></ul>
JQuery code now does not pick up the last ul with both class1 and class2 as the last element, and does not add the lastUI class.
+2
a source to share