Why would I want to access or tweak a node's attributes?


#1

Question

Why would I want to access or tweak a node’s attributes?

Answer

With the DOM we have access to all of our elements’ attributes and with this access we can also modify their attributes - including the ability to change our element’s class or id attributes to potentially change it’s styles, add functionality, and the ability to get data, among other possibilities!