If page is active, change class of nav
li
?
I've tried this:
var page = 'home';
if (page == $("#home").value) {
$( "#NavHome" ).addClass( "active" );
};
And the html:
<li id="NavHome">
Home
</li>
On the page itself I made this:
<input type="hidden" id="home" value="home">
I want if the page is active, the class of #NavHome
is active, if not, don't set the class to active..
Can someone help me or do you have a better solution?
Those doesn't help me: