getAttribute returns the value of the named attribute on the current node.
Syntaxattribute = element.getAttribute(name)
name is the name of the attribute whose value you want to get.
getAttribute is another very common and useful method for web developers. The corollary to this method is setAttributeNS, which allows you to change the value of a named attribute.