After reading http://www.w3schools.com/tags/tag_noscript.asp confused about onclick event on noscript tag.
Anybody knows the purpose?
If there is no purpose, why the hell they keep it?
Thanks for any answers in advance.
After reading http://www.w3schools.com/tags/tag_noscript.asp confused about onclick event on noscript tag.
Anybody knows the purpose?
If there is no purpose, why the hell they keep it?
Thanks for any answers in advance.
The DOM 0 events are inherited by most html elements, I just don't think they did anything to prevent noscript
from inheriting those, and those would be useless indeed. I would not recommend using w3schools as a reference exactly for this purpose, because it does incorporate bad practices and sometimes the information is inaccurate, unclear and/or confusing.
the #events it owns:
<!ENTITY % events
"onclick %Script; #IMPLIED -- a pointer button was clicked --
ondblclick %Script; #IMPLIED -- a pointer button was double clicked--
onmousedown %Script; #IMPLIED -- a pointer button was pressed down --
onmouseup %Script; #IMPLIED -- a pointer button was released --
onmouseover %Script; #IMPLIED -- a pointer was moved onto --
onmousemove %Script; #IMPLIED -- a pointer was moved within --
onmouseout %Script; #IMPLIED -- a pointer was moved away --
onkeypress %Script; #IMPLIED -- a key was pressed and released --
onkeydown %Script; #IMPLIED -- a key was pressed down --
onkeyup %Script; #IMPLIED -- a key was released --"
>
I suspect the standards committee just failed to add noscript
to the list of tags that don't accept standard events such as onclick
-- base, bdo, br, frame, frameset, head, html, iframe, meta, param, script, style, and title.
Quoting from the W3Schools link you provided:
"According to the W3C standard, the <noscript> tag supports event attributes. However, since the noscript element is used to provide an alternate content for users that have disabled scripts, we cannot see any use for this." -- http://www.w3schools.com/tags/tag%5Fnoscript.asp
This applies not just to onclick but also to ondblclick, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onkeydown, onkeypress and onkeyup.