Remove all attributes

A simple method that doesn’t require JQuery:

while(elem.attributes.length > 0)
    elem.removeAttribute(elem.attributes[0].name);

Leave a Comment