🔰 JS ⟩ DOM ⟩ Types ⟩ Element ⟩ .attr()
// ⭐️ get/set attribute Element.prototype.attr = function(name, value){ if (value !== undefined) { this.setAttribute(name, value) }; return this.getAttribute(name) || undefined; };
HTML element attribute
$(), $all()
"data-xxx" Attributes
MDN ⟩ Element ⟩ .setAttribute()
Last updated 1 year ago