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