Skip to content

Instantly share code, notes, and snippets.

@KruegerDesigns
Created January 21, 2012 00:43
Show Gist options
  • Save KruegerDesigns/1650483 to your computer and use it in GitHub Desktop.
Save KruegerDesigns/1650483 to your computer and use it in GitHub Desktop.
CSS Selector Classes Via jQuery
// creates classes for these selector behaviors
$(":first-child").addClass('first-child');
$(":last-child").addClass('last-child');
// keep this in mind if you need to remove one
// of the previous classes from an element
$('.Email').removeClass('first-child')
@KruegerDesigns
Copy link
Author

Special shout out to Hilyin (https://github.com/hilyin) for showing me this useful quick method! XD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment