Program Code – Mouse Over event

This program written in simple HTML (Hyper Text Markup Language) and with using Javascript.It’s work on any browsers.

Onload event

The onload event occurs when an object has been loaded . onload is most often used within the <body> element to execute a script once a web page has completely loaded all content (including images, script files, CSS files, etc.).The onload event can be used to check the visitor’s browser type and browser version, and load the proper version of the web page based on the information.


<element onload="myScript()">
<title>On Mouse over event</title>
<script language="javascript">
function imageinit()
{	img1On=new Image();
	img1Off=new Image();
function imageSwitchOn(imagename)
function imageSwitchOff(imagename)
<body onLoad="imageinit()"> 
<h3><i>Place your mouse pointer on the picture</i></h3>
<a onMouseOver="imageSwitchOn('img1')" onMouseOut="imageSwitchOff('img1')"> 
<img src="star1.jpg" height=200 width=200 alt="space" name="img1"></a>

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.