Created
March 4, 2014 02:43
-
-
Save xd547/9339350 to your computer and use it in GitHub Desktop.
jQuery Object compare
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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