I want to add an active class to a nav element, but i don't get it working. My code is:
$(document).ready(function() {
if ($('a[href="<?php echo RoutingClass::getView(); ?>"]') == $('a[href="home"]')) {
$('a[href="home"]').addClass('active');
}
});
and when its parsed in the browser, it looks like this (on the homepage):
$(document).ready(function() {
if ($('a[href="home"]') == $('a[href="home"]')) {
$('a[href="home"]').addClass('active');
}
});
when i leave out the if comparison, it just adds the active class, but in it, it doesnt.