javascript - How do I change cursor on keypress (Ctrl) in JQuery? -


using jquery, change cursor on page when key pressed (for example ctrl). simple task, can not make work... first idea, - not work:

$(document).on('keydown',function(){   $(document).css('cursor','wait'); }); 

any idea wrong?

think want this:

$('body').css('cursor','wait'); 

you can't apply css document. if wanted apply css ctrl key press do:

$(document).on('keydown', function (event) {     if (event.ctrlkey) {         $('body').css('cursor', 'wait');     } }); 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -