#jQuery #attr() .attr() .attr() gets the value of an attribute on an element or adds an attribute. grammar 1 .attr( attributeName ) Add attributes to the selected element. for example $( 'div' ).attr( 'class' ); will get the value of the class attribute of the div element. grammar 2 .attr( attributeName, value ) Add attributes to the selected element. for example $( 'h1' ).attr( 'title', 'Hello'..