The # in the tool bar above the text input box will give you the [code] tags.
You can not hover over something that is not there. So I got rid of the big black box and made it with the four divs. Of course I had to set their initial color to black and change it on hover (CSS).
To do a click you do need javascript. I broke that into two sections. One to get rid of any box color that was showing already and two to set the color of the section clicked on.
Hope this is what you wanted. jquery might be a little simpler with a toggle, but I did it so you could see whats going on.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="">
function my_click(clicked_id)
{
document.getElementById('spot1').style.backgroundColor='';
document.getElementById('spot2').style.backgroundColor='';
document.getElementById('spot3').style.backgroundColor='';
document.getElementById('spot4').style.backgroundColor='';
if(clicked_id == 1) document.getElementById('spot1').style.backgroundColor='red';
if(clicked_id == 2) document.getElementById('spot2').style.backgroundColor='purple';
if(clicked_id == 3) document.getElementById('spot3').style.backgroundColor='green';
if(clicked_id == 4) document.getElementById('spot4').style.backgroundColor='blue';
}
</script>
<style type="text/css">
body {color:#ccccff;}
#spot1:hover{
background-color: red;
}
#spot1{
position:absolute;
width:50px;
height:50px;
top:0px;
left:0px;
background-color: black;
}
#spot2:hover{
background-color: purple;
}
#spot2{
position:absolute;
width:50px;
height:50px;
top:0px;
left:50px;
background-color: black;
}
#spot3:hover{
background-color: green;
}
#spot3{
position:absolute;
width:50px;
height:50px;
top:50px;
left:50px;
background-color: black;
}
#spot4:hover{
background-color: blue;
}
#spot4{
position:absolute;
width:50px;
height:50px;
top:50px;
left:0px;
background-color: black;
}
</style>
</head>
<body>
<div id="spot1" class="sections" onclick="my_click('1')"></div>
<div id="spot2" class="sections" onclick="my_click('2')"></div>
<div id="spot3" class="sections" onclick="my_click('3')"></div>
<div id="spot4" class="sections" onclick="my_click('4')"></div>
<div id="display">Some Text</div>
</body>
</html>
We start with a box colored black and change it's color upon hover or when we click it. The hover is temporary and the click is permanent.