Learn HTML DOM
Manipulating DOM Elements
4.15
Lesson

Get Attributes for an Element

To access attribute values for an HTML element, you can simply look up the value of that property on the node object.

Look at the example given below: