highlight current page link in navigation item css jquery


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. var path = location.pathname.substring(1);
  2. if ( path )
  3. $('#menu a[href$="' + path + '"]').attr('class', 'selected');

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.