code-guide icon indicating copy to clipboard operation
code-guide copied to clipboard

Attribute order for onclick event attributes

Open vanillajonathan opened this issue 3 years ago • 2 comments

The HTML attribute order section does not include the order of event attributes such as onclick, onblur, onchange, etc.

vanillajonathan avatar Mar 08 '22 16:03 vanillajonathan

Might be due to usage of event attributes being discouraged. From MDN:

You can find HTML attribute equivalents for many of the event handler properties; however, you shouldn't use these — they are considered bad practice. It might seem easy to use an event handler attribute if you are doing something really quick, but they quickly become unmanageable and inefficient.

msantana-dev avatar Apr 09 '22 00:04 msantana-dev

Yes, but when you use an SPA such as React you would use event handlers such as onClick, onBlur, onChange, etc, or with Vue @click, @blur, @change, or with Angular (click), (blur), (change).

vanillajonathan avatar Apr 09 '22 10:04 vanillajonathan