|
February 2, 2000 Event Handler Definition Tips: February 2000
Yehuda Shiran, Ph.D.
|
|
Internet Explorer 4.0x and up supports the two most basic event handler methods:
Consider the following form definition:
When you click the button, nothing happens because no script or function is attached to its click event. For instance, you could associate it with a function that generates an alert dialog box by placing an onClick event handler script in the body of the tag:
Another way to associate a function with a specific event is to assign its reference to the object's event handler property:
And yet another variation on the same theme is defining the event handler function in-line. We chose a different event handler to demonstrate the usage of
Learn more about event handling in The Internet Explorer Event Model.
People who read this tip also read these tips: Look for similar tips by subject: |