Code to hide and show a div tag using javascript onmouseover and onfocus

Monday, January 18, 2010

<html>
<head>
<script language="JavaScript">
function showhide(id, visibility) {
document.getElementById(id).style.display = visibility;
}
</script>
</head>
<body>
<a href='#' onMouseOver="showhide('divContent', 'inline');" onMouseOut="showhide('divContent','none');" onfocus="showhide('divContent','inline')"; onBlur="showhide('divContent','none')";>This program shows and hides a div using javascript.</a>
<div id="divContent">This program shows and hides a div using javascript.</div>
</body>
</html>
<a href="http://www.codecollege.NET">www.codecollege.NET</a>

0 comments

Post a Comment

LinkWithin

Blog Widget by LinkWithin

Recommended Books