Skip to content

Instantly share code, notes, and snippets.

@addisonhall
Created February 19, 2014 18:21
Show Gist options
  • Save addisonhall/9098169 to your computer and use it in GitHub Desktop.
Save addisonhall/9098169 to your computer and use it in GitHub Desktop.
jQuery if element exists
// if element length is greater than 0
if ($('.selector').length) {
// do something
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment