开发者

What do the attributes do in <script for=foo event=onmouseover>

I read some HTML like:

<script for开发者_开发知识库=foo event=onmouseover> ... </script>

Just wondering what the attributes for=foo event=onmouseover mean?


According to the specifications of HTML 4.01/5 and XHTML those attributes are invalid. Also see the W3C specification.

But it turns out that the attributes are proprietary to Internet Explorer, they can be found on MSDN, e.g., in SCRIPT XHTML Element:

EVENT – Specifies the name of the event handler that the enclosed script is bound to

FOR – Specifies the name of the object that the event script is bound to

Two other pages talk about these attributes with more depth: EVENT Attribute and FOR Attribute. Notice that both have a note:

Standards Information

This property is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 2 World Wide Web.

This is, of course, not true.

Also see Attaching an Event Handler, which discusses the various methods with which an event handler can be bound to an element.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜