Click to return to the DHTML, HTML     
ENCTYPE Attribute | encod...     expando Property     DHTML Properties    
Web Workshop  |  DHTML, HTML & CSS

EVENT Attribute | event Property


Retrieves the event for which the script is written.

Syntax

HTML<SCRIPT EVENT = sEvent ... >
Scripting[ sEvent = ] script.event

Possible Values

sEventString that specifies the event. The value for an onmouseover event, for example, is "onmouseover()".

The property is read-only with no default value.

Example

This example uses the EVENT attribute and the event property to handle the onclick event.

Sample Code

<SCRIPT ID=oButtonScript FOR="oButton" EVENT="onclick()">
    var sMessage1 = "Flip"
    var sMessage2 = "Flop"
    if (oButton.innerText == sMessage1) {
        oButton.innerText = sMessage2;
        }
    else {
    if (oButton.innerText == sMessage2) {
        oButton.innerText = sMessage1;
        }
</SCRIPT>
</HEAD>
<BODY>
:
<BUTTON ID="oButton" onmouseout="alert(oButtonScript.event)">Flip</BUTTON>

This feature requires Internet Explorer 4.0 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:

SCRIPT

See Also

event



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.