Created
February 2, 2015 16:36
-
-
Save eatonphil/ef39c7a083bdc154f1a4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/* | |
* Original Source: http://stackoverflow.com/questions/1318076/jquery-hasattr-checking-to-see-if-there-is-an-attribute-on-an-element | |
* | |
* jQuery add-on to check if an element has an attribute. | |
*/ | |
jQuery.fn.hasAttr = function(name) { | |
return typeof this.attr(name) === typeof undefined || this.attr(name) === false; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment