How do I copy the attributes of one element to another element?
HTML
Pretty Simple
function cloneAttributes(element, sourceNode) { let attr; let attributes = Array.prototype.slice.call(sourceNode.attributes); while(attr = attributes.pop()) { element.setAttribute(attr.nodeName, attr.nodeValue); } }