/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// Side Navigation Select $('a').addClass(function() { if ($(this).attr('class')==$('body').attr('id')) { return 'active'; } }); // NOTE: // add id that is the name of the page to body tag i.e. <body id="home"> // create active css with styles active {text-decoration: underline;}