How can I change the mouse cursor in Javascript or in jQuery ? I know it’s a very classic question, but very strangely this JSFiddle doesn’t work : http://jsfiddle.net/2Qffw/.
Here is the code :
JavaScript
x
4
1
$('body').css('cursor','pointer');
2
3
document.body.style.cursor = "pointer";
4
Advertisement
Answer
Do it in both html
and body
:
JavaScript
1
2
1
$('html,body').css('cursor','crosshair');
2