In the previous article we learnt how to use DOM object window to set the text in the status bar of a window. You can use the same status property to set the different text in the status bar using onmouseover event of different html tags. Onmouseover event takes action when mouse pointer moves over any html event e.g. html button, hyperlink or image.

Here we will learn to set the window status bar text on onmouseover event of <img> tag of html code.

Javascript Code to Set Window Status using onmouseover

<html>
<head>
    <title>JavaScript onmouseover set Window Status</title>
</head>
<body>
    <img src="image1.jpg" 
            onmouseover="window.status='your mouse is rolling over image 1';" 
            onmouseout="window.status='';">
    <br />
    <img src="image2.jpg" 
            onmouseover="window.status='your mouse is rolling over image 2';"
            onmouseout="window.status='';">
    <br />
    <img src="image3.jpg" 
            onmouseover="window.status='your mouse is rolling over image 3';"
            onmouseout="window.status='';">
    <br />
</body>
</html> 

As shown in the above code you can also use the onmouseout event to remove the window status text when mouse moves out from the <img> element of html.

Above example will display the different onmouseover window status messages for each image. You can display the image description similar to the alt attribute of image tag in window status bar.

Continue to next tutorial: Javascript Copy Text to Clipboard to learn how to store the copied text to the windows clipboard.

Recent JavaScript Tutorials

Javascript FSO ShortPath property

Javascript FileSystemObject (FSO) provides a ShortPath property that can be accessed using the folder object or file object returned by the GetFolder or GetFile method.

Javascript FSO Path Property

Javascript FileSystemObject (FSO) provides the Path property that can be accessed through the file object or folder object returned by the GetFile or GelFolder method

Javascript FSO Type property

Javascript FileSystemObject (FSO) provides a Type property that can be accessed through file object or folder object returned by the GetFile or GetFolder method

Javascript FSO ShortName property

Javascript FileSystemObject (FSO) provides a ShortName property that can be accessed using the folder object or file object returned by the GetFolder or GetFile method.

Javascript FSO Name Property

Javascript FileSystemObject (FSO) provides a Name property that can be accessed using file object or folder object.