JavaScript Events.
When a user causes an event to happen on an HTML page, such as clicking on a link, a piece of JavaScript can be executed. Most HTML tags have certain events that can be used to trigger JavaScript, examples of such events are ‘onClick’ and ‘onMouseOver’. When developing a web page, which uses such events, you need to be careful about compatibility issues as Netscape Navigator and Microsoft Explorer differ in the type of events each HTML tag is capable of supporting.
< a onClick="document.write('you clicked me!');">click here< / a >
< html >
< body >
< img src ="Img/elep.jpg" name="elephant " onmouseover="document.images['elephant'].src='Img/elep.jpg';" onmouseout="document.images['elephant'].src='Img/monkey.jpg';">
< /body >
< /html >
No comments:
Post a Comment