Skip to content

Instantly share code, notes, and snippets.

@Teino1978-Corp
Created November 20, 2015 07:53
Show Gist options
  • Save Teino1978-Corp/74dea96ddb66972120b5 to your computer and use it in GitHub Desktop.
Save Teino1978-Corp/74dea96ddb66972120b5 to your computer and use it in GitHub Desktop.
jQuery hasAttr function
/* HAS ATTRIBUTE */
$.fn.hasAttr = function(attrName){
var element = this[0];
if(element.hasAttribute){
return element.hasAttribute(attrName);
}
return element[attrName] !== undefined;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment