Related: Why is using onClick() in HTML a bad practice?. See also Unobtrusive JavaScript.
Unobtrusive JavaScript is a general approach to the use of JavaScript in web pages. Though the term is not formally defined (emphasis added)
Questions:
- At what point was the determination made that using
onclick
or other global event handler attributes withinhtml
was "considered" a "bad practice"? - By whom was the determination made that using global event handler attributes within
html
was a "bad practice"? - If the user who drafts the
html
and includes global event handler attributes within thehtml
is aware of the event handler attributes' presence within thehtml
, how could this be "considered" "bad practice"? Should a composer of
html
not ever include an event handler attribute withinhtml
?Are there any cases where including event handler attributes within
html
would not be "considered" a "bad practice"?Exactly whose "consideration" of a practice should the composer of the
html
,javascript
defer to? That is, what is the reference point for a composer to review whether a particular practice is currently "considered" "bad", "not bad" or "good"? Or, is there a list which tallies all "considerations" of those that "consider" the many possible practices which could be implemented withinhtml
,javascript
?
For clarification, attempting to ascertain exactly when, and by whom, the term or phrase "bad practice" or "considered bad practice" was attached to the usage of global event handlers within html
? And what is the official or pseudo-official document or set of documents which list the votes of those that participated in the "consideration" process that leads to a "bad" or "good" designation?
Or, is the term "considered bad practice" primarily opinion-based?