Find current link and apply CSS
I have list of links inside a DIV. I am trying to apply CSS to the current page link but it does not work. My code is as follows.
var url = document.location.toString();
var chunks = url.split('/');
var newUrl = chunks.slice(0,chunks.length -2).join('/');
$('div.maacmenu-toplinks a[href*=newUrl]').addClass('activeClass');