I am trying to remove some string from a string in Jquery but it doesnt work and my variable still looks the same.
var classes = $("body").attr('class');
alert('.side-nav' + classes);
classes = classes.replace('.side-navblog parent- page- how-it-works-','');
$(".side-nav" + classes).css("display","block");
When I alert classes after it has been replaces, there is still .side-navblog parent- page- how-it-works- in the string which I do not want.
.removeClass?.so'.side-navblog parent- page- how-it-works-'should be'side-navblog parent- page- how-it-works-'