document ready function var url document location href each div menu f

1
2
3
4
5
6
7
$(document).ready(function() {
var url=document.location.href;
$.each($("div.menu a"),function(e){
if(url==this.href){$(this).addClass('active');};
});
});