How can I add variables into my selectors :
function addCurrentClass(){
var loc = window.location;
$('#nav li a[href = "' + loc + '"]').addClass('currentpage');
}
I've tried many variations of the above using different types of selectors and can't get it to change to the value contained in var loc.
Any ideas?
Thanks