Get the latest tech news

HTML Attributes vs. DOM Properties


They're completely different, but often coupled.

I think it's good that developers can have a long and happy career without caring about the differences between properties and attributes. In order to work in the serialised format, attribute values are always strings, whereas properties can be any type: On all elements, el.ariaLabel reflects the aria-label attribute (the aria reflectors became cross browser in late 2023.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of HTML Attributes

HTML Attributes

Photo of DOM Properties

DOM Properties