The .attr() method is a convenient way to set the value of attributes—especially when setting multiple attributes or using values returned by a function ...
The getAttribute() method of the Element interface returns the value of a specified attribute on the element. Element: getAttributeNames · setAttribute() method · Element.hasAttribute()
The setAttribute() method of the Element interface sets the value of an attribute on the specified element. Element.removeAttribute() · Element.setAttributeNS() · Element.setAttributeNode()
The IDL attribute is also known as a JavaScript property. These are the attributes you can read or set using JavaScript properties like element. Accept · Global attributes · Tabindex · Try it