Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaScript Change Cursor Icon

I already have the conditions and everything worked out, only thing I need is the syntax in JavaScript to change the cursor to the hand, like the user has moused-over a link, and then I need the syntax to change the cursor to the arrow, like they moused-out of the link. Not much to it, just need the JavaScript syntax for changing cursors.

Only thing is this needs to work in IE, FF, Chrome, Safari, and preferably Opera.

Thanks in advance!

like image 493
Doug Avatar asked Jan 22 '23 12:01

Doug


1 Answers

First, I'm shocked this question has no answers and no comments about how easy it would be to Google the answer.

The syntax you're looking for is: object.style.cursor = 'pointer', where object is the DOM object for which you're trying to change the cursor.

Here's an example: http://jsfiddle.net/3q5Yh/

like image 171
stevelove Avatar answered Jan 24 '23 01:01

stevelove