๐งelem.attr()
๐ฐ 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
MDN โฉ Element โฉ .setAttribute()
Last updated
Was this helpful?