Skip to content

Instantly share code, notes, and snippets.

@digitup
Created November 2, 2012 10:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save digitup/3999992 to your computer and use it in GitHub Desktop.
Save digitup/3999992 to your computer and use it in GitHub Desktop.
jQuery - add an active class to the current URL
var url = document.URL;
$('#menu a[href="'+url+'"]').addClass('active');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment