The html structure below is giving me trouble:
<div class="sub">
<a href="#" id="people">People</a>
</div>
The CSS for the "a" element is as follows:
color:#999999;
font-size:31px;
I am attempting to use jQuery to change the color by adding a class "active" with the style "color:#777!important;", but my current approach is not working. I have tried the following code:
$('.sub').click(function() {
$('a#people').addClass('active');
})
However, it does not seem to be functioning as expected. I have also attempted to add the class using this code:
$('.sub a').addClass('active');
If anyone has any suggestions on how to properly add a class to an "a" element, I would greatly appreciate it.
Thank you.