Re:HTML Attributes vs. DOM Properties
by tomjakubowski on Thursday April 25, 2024 @08:32AM
(#40156704)
Making attributes and properties symmetric to one another would be difficult for the existing DOM API: methods like `addEventListener` are (prototype) properties on individual DOM elements, but would be nonsensical string attributes. Making your idea concrete:
So DOM element methods would instead be free functions like:
It's a matter of taste, but I for one appreciate having object method calls in JavaScript.
[ Parent
| on HN ]
There are no comments on this comment yet.