<div class="menu4">
<a href="http://URL1">URL 1</a>
<a href="http://URL2">URL 2</a>
</div>
$('.menu4').find('a').each(function(){
var urlNow = window.location.href;
var urlLink = $(this).attr('href');
if(urlLink = urlNow) {
$('a[href="'+urlNow+'"]').addClass('active');
}
});
var urlNow = window.location.href;
$('a[href="'+urlNow+'"]').addClass('active');