'Change the mouse cursor on mouse over to anchor-like style

If I hover the mouse over a div the mouse cursor will be changed to the cursor like that in HTML anchor.

How can I do this?



Solution 1:[1]

If you want to do this in jQuery instead of CSS, you basically follow the same process.

Assuming you have some <div id="target"></div>, you can use the following code:

$("#target").hover(function() {
    $(this).css('cursor','pointer');
}, function() {
    $(this).css('cursor','auto');
});

and that should do it.

Solution 2:[2]

You actually don't need jQuery, just CSS. For example, here's some HTML:

<div class="special"></div>

And here's the CSS:

.special
{
    cursor: pointer;
}

Solution 3:[3]

This will

#myDiv
{
    cursor: pointer;
}

Solution 4:[4]

I think :hover was missing in above answers. So following would do the needful.(if css was required)

#myDiv:hover
{
    cursor: pointer;
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ryan Atallah
Solution 2 attack
Solution 3 Sinetheta
Solution 4 being_ethereal