Skip to content

Instantly share code, notes, and snippets.

@marioblas
Last active April 12, 2016 09:16
Show Gist options
  • Save marioblas/11286231 to your computer and use it in GitHub Desktop.
Save marioblas/11286231 to your computer and use it in GitHub Desktop.
jQuery - Get the last class of an element
/**
* Get the last class of an element
*/
var lastClass = $('.foo').attr('class').split(' ').pop();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment