Tutorial Test if Element Supports Attribute
Not all browsers support all attributes on all elements. There are a number of new attributes in HTML5, so the idea of testing to see what k...
https://iskablogs.blogspot.com/2014/03/tutorial-test-if-element-supports.html
Not all browsers support all attributes on all elements. There are a number of new attributes in HTML5, so the idea of testing to see what kind of browser environment you are in becomes every increasingly important.
function elementSupportsAttribute(element, attribute) {
var test = document.createElement(element);
if (attribute in test) {
return true;
} else {
return false;
function elementSupportsAttribute(element, attribute) {
var test = document.createElement(element);
if (attribute in test) {
return true;
} else {
return false;