I'm beginner in Javascript. I have a list of links and I want to select links end with .zip and add class zip from css;
add select links end with not .zip and add class notzip from css.
I use
$("a[href $='.zip']").addClass("zip") to do the first task but cannot do the task 2 by add ! or not(). It is recommended by $this and location, filter function. How can I do that?
<ul>
<li><a href="a.html">a</a></li>
<li><a href="b.pdf">b</a></li>
<li><a href="c.zip">c</a></li>
</ul>