Change CSS Style using Mouse Events

<html>
<head> 
<h1> Javascript Events </h1>
</head>
<body>
<script language="Javascript" type="text/Javascript">
<!--
function mouseoverevent()
{
                document.getElementById("p2").style.color = "blue";
}
        function mouseoutEvent()
{
alert("This is MouseOut");
                document.getElementById("p2").style.color = "red";
}
 function mousedownEvent()
{
alert("This is Mousedownt");
                document.getElementById("p2").style.color = "violet";
}

//-->
</script>
<p id="p2" onmouseover="mouseoverevent()"  onmouseout="mouseoutEvent()" onmousedown="mousedownEvent()" > Keep cursor over me</p>

</body>
</html>
Output : 
 

Javascript Events

Keep cursor over me

Comments

Popular posts from this blog

Javascript Code using getElementById and If Else Statement

Window Screen Properties