Sunday, 8 July 2012

Triggering a Script


Triggering a Script



In many cases, you won't want the script to run automatically. You might only want the script to run if the user does something (like hover over a link), or once the page has finished loading.
These actions are called intrinsic events (events for short). 

There are 18 pre-defined intrinsic events that can trigger a script to run. You use event handlers to tell the browser which event should trigger which script. These are specified as an attribute within the HTML tag.

Lets say you want a message to display in the status bar whenever the user hovers over a link. The act of hovering over the link is an event which is handled by the onmouseover event handler. You add the onmouseover attribute to the HTML tag to tell the browser what to do next.

HTML Code:

Treat yourself to a <a href="http://www.great-workout.com/killer-ab-workout.cfm" onMouseover="window.status='Go on, you know you want to'; return true">Killer Ab Workout</a>

No comments:

Post a Comment

Physics basic inventions and inventors

1.Which instrument is used to measure altitudes in aircraft's ? Audiometer Ammeter Altimeter Anemometer Explanation : ...