Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the purpose of onclick event for noscript tag?

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.

like image 935
rajakvk Avatar asked Dec 18 '25 00:12

rajakvk


2 Answers

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.

like image 68
Asaph Avatar answered Dec 19 '25 16:12

Asaph


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 --"
  >
  • http://www.w3.org/TR/REC-html40/interact/scripts.html#h-18.3.1
  • http://www.w3.org/TR/REC-html40/sgml/dtd.html#events
like image 22
meder omuraliev Avatar answered Dec 19 '25 15:12

meder omuraliev