$(document).ready(function() { var current_path =window.location.pathname; console.log(current_path); $('.sub_tab_menu ul li a[href="'+current_path+'"]').addClass('active'); });