NEPAL | ARTICLES | KAVITAHARU | MANTHAN | COOL LINKS | GUESTBOOK | SEARCH |
|||
JAVASCRIPT NEPAL KAVITAHARU ARTICLES COOL LINKS ADD EMAIL GUESTBOOK KURAKANI FREE E-CARDS FREE SITE SUBMIT
ABOUT ME |
| ||
If user makes JavaScript program to react while clicking on a button or moving mousepointer on a link. It is said to be click- event and MouseOver- event respectively. So the event handler are 0nClick, onMouseover, onMouseout, onLoad, onUnload, onReset, onSelect, onSubmit, onFocus, onBlur, onChange, onAbort, onError etc, which are used in either in <a href=""></a> or <input type=""> using <form>. Image ObjectProperties: src, height, width, border, vspace, hspace Method: onMouseover, onMouseout, onLoad, onUnload, onError, onAbort Example using <a href> <A HREF="javascript:void(0)" onMouseOut="Image.src='your image2.gif'" OnMouseOver="Image.src='your image1.gif'"> <IMG name="Image" src="your image2.gif" border=0></A> Event will occur when we put mousepointer over the image which is a OnMouseOver event and again another event will take place when we move the mousepointer out of the image which is OnMouseOut event and both are the event handler. The change of images known as image rollover needs two images, when mousepointer is placed on an image, another image will be loaded and, the first one will be loaded again when mousepinter is rolled out of the image. Another example using <form><form> <IMG NAME="cheetah" src="cheetah02.gif"> <INPUT TYPE="BUTTON" VALUE="STOP" onClick="cheetah.src='cheetah02.gif'"> <INPUT TYPE="BUTTON" VALUE="RUN" onClick="cheetah.src='cheetah.gif'"> </form> Events have been made to occur using onClick event handler with the use of <FORM>. "for" loop As I have understood, a for loop is used if someone wants to repeat an action several times. Here is an example of the use of a for loop. Example of "for" loop <script language="JavaScript> <--hide from older browser for (y=0; y<=5; y++){ alert("Hi! there") } //--> </script> This will alert "Hi! there" six times. y=0 is a starting point of a for loop. y=5 is maximum boundary of for loop. y=++ is for incrementing for loop one step each time until the maximum boundary. |
Home
| About Me
| Nepal
| Articles
| Kavitaharu
| Cool Links
Javascript | Add Email | Guestbook |