Im trying to change the color of the div using omMouse ove Event handler. From grey to black But it doesnt work.
Whats wrong here ? Also how to use onHover and onMouseout ?
<html>
<head>
<title></title>
<link type="text/css" href="" />
<script type="text/javascript" src="" ></script>
<style>
div{
height: 100px;
width: 100px;
background-color: grey;
}
</style>
</head>
<body>
<div onMouseover="this.bgColor = '#FFFFFF'">
</div>
</body>
<script>
</script>
</html>
You can do by doing this
By tag
div:hover {
background-color: red;
}
By div Class
.divclass:hover {
background-color: red;
}
By div Id
#divclass:hover {
background-color: red;
}