Skip to content

Instantly share code, notes, and snippets.

@hermpheus
Created March 26, 2012 04:13
Show Gist options
  • Save hermpheus/2202892 to your computer and use it in GitHub Desktop.
Save hermpheus/2202892 to your computer and use it in GitHub Desktop.
JavaScript: Detect Browser Support for HTML5 Attribute
function elementSupportsAttribute(element,attribute) {
var test = document.createElement(element);
if (attribute in test) { return true; }
else { return false; }
}
@hermpheus
Copy link
Author

From HTML5 for Web Designers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment