Skip to content

Instantly share code, notes, and snippets.

@digitup
Created November 2, 2012 10:25
Show Gist options
  • Select an option

  • Save digitup/3999992 to your computer and use it in GitHub Desktop.

Select an option

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