Skip to content

Instantly share code, notes, and snippets.

@xd547
Created March 4, 2014 02:43
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 xd547/9339350 to your computer and use it in GitHub Desktop.
Save xd547/9339350 to your computer and use it in GitHub Desktop.
jQuery Object compare
// from http://stackoverflow.com/questions/2436966/how-would-you-compare-jquery-objects
// You need to compare the raw DOM elements, e.g.:
if ($(this).parent().get(0) === $('body').get(0))
// or
if ($(this).parent()[0] === $('body')[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment