Return to Snippet

Revision: 30394
at August 13, 2010 03:52 by vagrantradio


Initial Code
function checkAttribute(element, attribute) {
	var test = document.createElement(element);
	if (attribute in test) {
		return true;
	} else {
		return false;
	}
}	

//usage
if (!checkAttribute('input', 'placeholder')) {

}

Initial URL


Initial Description
Generic function to test whether and element supports a particular element in HTML5.

Initial Title
HTML5 Test Attribute Support

Initial Tags
html5

Initial Language
HTML