<script>
$(function() {
var pgurl = window.location.href.substr(window.location.href.lastIndexOf("/") +1);
$(".menu li a").each(function() {
if ($(this).attr("href") == pgurl || $(this).attr("href") == '')
$(this).addClass("active");
});
});
</script>
and why we add '1' in 3rd line (highlight with red color)?
Thanks in advance.