🚧elem.attr()

🔰 JSDOMTypesElement ⟩ .attr()

// ⭐️ get/set attribute
Element.prototype.attr = function(name, value){
    if (value !== undefined) { this.setAttribute(name, value) };
    return this.getAttribute(name) || undefined;
};

Last updated