HTML:
<ul id="list">
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
<li class="action">item</li>
</ul>
jQuery:
$("#list li:last").addClass("active");
This almost works, but the "action" item takes the "active" class when its present which I don't want. How do I rewrite the above jQuery so it always ignores the li.action
and assigns "active" class to the last li
before it??
Thanks