Is there a native way, no jQuery, to check if a dom element has the attribute with the selected value. For example:
//assume doc has
data-mod="do" defined
This will be true:
document.hasAttribute('data-mod');
but this will be false:
document.hasAttribute('data-mod="do"')
Is there any way to natively check for a data attribute on a DOM element with the value?
document
doesn't have attributes. Do you mean an element in the document, or a specific element has an attribute? – Titustityusjquery
tag at Question ? – Weakkneed