News for hackers. Stuff that matters.
Re:HTML event handler attributes: down the rabbit hole by chris37879 on Tuesday April 26, 2022 @05:50PM (#31173618)
I prefer them too for the same reasons, they're even available with a really similar syntax in React's JSX extension: <button onClick={onClickHandler}>

I'm a big fan of the data attributes for the same reason, they bind onto the actual element they belong with, they're available in JS and CSS, and they add semantic meaning to your markup when you're reading the source.

There are no comments on this comment yet.