0

I want to change cursor type & backcolor when mouse moves over a td,Suppose I want to chnage the cursor to Hand, & backcolor to Blue on mouse move, & on mouse leave i want to change the cursor to default..How to do it?????????

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by Dhaneshnm
0

The below code should solve the problem...

<td                
onmouseover="style.backgroundColor='blue'"                 onmouseout="style.backgroundColor=''"                         style="cursor:pointer;">
        hi
  </td>

Edited by Dhaneshnm: n/a

0

Thx...
Thru JS

<script type ="text/javascript"  >
    
    function onMouseMove()
    {
    document.getElementById("1").style.backgroundColor ="skyblue";  
    document.body.style.cursor = 'hand';
    }
    
    function onMouseLeave()
    {
    document.getElementById("1").style.backgroundColor ="";
    document.body.style.cursor = "default";
    }
    </script>

<td  id="1" style="width: 98px; height: 46px;" onMouseOver="onMouseMove()" onMouseOut="onMouseLeave()">
                    </td>
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.