In MSIE, you can give each <INPUT> tag a NAME attribute.
This can then be used to map a <SCRIPT> block to that <INPUT> object. The <SCRIPT> block is further mapped to the event names that the <INPUT> block might generate trigger events for. You end up with one <SCRIPT> block per event per named <INPUT> object.
The upside of this is that you don't have complicated function name mappings, but the downside is that you can end up with a large number of discrete <SCRIPT> blocks.
Internally, MSIE has to be turning these into some kind of function object otherwise they would be interpreted as inline Global code.
Beware of using functionality that is not portable to your entire target audience. This is useful, but only on MSIE browsers. This capability is born out of the VBScript support in MSIE and is better confined to that language.
See also: | <SCRIPT EVENT="...">, Element.onevent, Script execution |
Prev | Home | Next |
Event handler | Up | Event handler properties |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |