Events & Events Handlers.

Events & Events Handlers. are very important in Jscript Programming.
Events are caused by user actions.
For example if user clicks a button, a click event occurs or If mouse pointer moves over a link
a mouseover event occurs.
e.g.
<form>
<input type=button Onclick=" alert ( ' HI ' ) " >
</form>

Events Events Handlers
Abort OnAbort (when user cancels loading of an image)
Blur Onblur (when focus is removed from a form element.)
Click Onclick (when user click in a Clickable field)
Change Onchange (when value of form field is changed by user)
Error OnError (when error occurs during loading of image or document.)
Focus Onfocus (when a field is selected)
Load

OnLoad (when page is loaded)

Mouseout Onmouseout (when user moves the mouse OFF the link or an clickable element.)
Mouseover Onmouseover (when user moves the mouse OVER the link or an clickable element.)
Reset Onreset (when a form is reset)
Submit Onsubmit (when a form is submitted)
Load Onload (when a page is loaded)
Unload Onunload (when a page is closed)

<a Onmouseover="alert('Hi Friends')"> Take you Mouse On Me </a>

Take you Mouse On Me



<a Onmouseout="alert('Hi Friends')"> Take you Mouse On Me </a>

Take you Mouse On Me

<form>
<input type="button" name="Button" value="Button" Onclick="alert('Thank you')">
</form>


<form>
<input type="text" name="textfield" value="Click me" Onfocus="alert('Hi Friends')">
</form>

 

Status bar:

function statbar ( txt )
{
window.status = txt;
}
</head>
<body>
<input type = "button" value="write" onClick="statbar( ' HI ' ) ">
<input type = "button" value="erase" onClick="statbar( ' ' ) ">
</form>

 

 

Back