$(function(){ var s = document.location.pathname if(s == '/' || s == 'index.html') $('#tech').addClass('className'); });