Click here to Skip to main content
15,897,226 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to change the mouse pointer on an event but it is not changing. Debugger shows that the event is firing but there is also not any problem with code there, is any?
JavaScript
this.top = $('#rootDiv_' + root);

this.top.mouseenter(function () {
            this.top.style.cursor = "pointer";
        });
Posted

Oh! I found the solution while posting it but post the question to give the solution others. I just followed 'this' in 'mouseenter' event and found that 'this' is already the div 'top'. Then why should I tell 'this' to select the 'top'. Then I obsolete the 'top' and the final code is:

JavaScript
this.top = $('#rootDiv_' + root); //Saves the created div in top.

this.top.mouseenter(function () {
            this.style.cursor = "pointer";
        });
 
Share this answer
 
try this

$("element").cursor("pointer")
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900