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?????????

Recommended Answers

All 3 Replies

The below code should solve the problem...

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

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>

Better!!!!!!!!!!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.