Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Can´t apply active class to sublinks on my page… Reply To: Can´t apply active class to sublinks on my page…

#199775
css_fan5
Participant

No. My previous nav was structured as several “a” links wrapped inside a div with id of “navi”. It was looping through all the a tags inside the #navi div and making the comparison.

The problem occurred when I placed these a tags inside li tags. Based on the HTML I have posted, how can I loop through the a tags and apply the class active? Do you have any suggestions???