attr
This method can be used to get or set the value of an attribute of the elements in the collection.
// Set an attribute of the elements
attr: function(name, value) {
this.elements.forEach(function(element) {
element.setAttribute(name, value);
});
return this;
},
// Get the value of an attribute of the first element
attr: function(name) {
return this.elements[0].getAttribute(name);
}