Skip to content

Instantly share code, notes, and snippets.

@bradwright
Created July 29, 2011 09:29
Show Gist options
  • Save bradwright/1113511 to your computer and use it in GitHub Desktop.
Save bradwright/1113511 to your computer and use it in GitHub Desktop.
Cross browser hasAttribute
function hasAttribute(node,attr) {
return node.hasAttribute ? node.hasAttribute(attr) : !!node.getAttribute(attr);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment