J
John Smith
I have a DIV element containing some text. I have onmouseover and on
mouseout events declared. However, the onmouseover event only fires with the
mouse is over the actual text, and not the div as a whole. I have tried
setting the div style to display:block, but it makes no difference. Any
ideas?
<DIV id='divTest' OnMouseOver='changeColor()' OnMouseOut='revertColor()'>
Hello, this is some test text!
</DIV>
javascript:
function changeColor(){
document.all('divTest').style.backgroundColor='red';
}
function revertColor(){
document.all('divTest').style.backgroundColor='blue';
}
mouseout events declared. However, the onmouseover event only fires with the
mouse is over the actual text, and not the div as a whole. I have tried
setting the div style to display:block, but it makes no difference. Any
ideas?
<DIV id='divTest' OnMouseOver='changeColor()' OnMouseOut='revertColor()'>
Hello, this is some test text!
</DIV>
javascript:
function changeColor(){
document.all('divTest').style.backgroundColor='red';
}
function revertColor(){
document.all('divTest').style.backgroundColor='blue';
}