I am trying to use jQuery to change the color of a link, but I keep getting an error when trying to reference the object.
Here is my HTML :
<a onmouseover="loclink(this);return false;" href="locations.html" title="Locations" class="nav-link align_nav">Locations</a>
And here is my JS code:
function loclink(a){
a.css("color", "red"); // This did not work
jQuery('a').find('.nav-link').css("color", "red"); // This also did not work
$(a).find('.nav-link').css("color", "red"); // And this did not work either
console.log(a):
<a onmouseover="loclink(this);return false;" href="locations.html" title="Locations" class="nav-link align_nav">Locations</a>