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

hibernate - How to load global settings frequently used in application in Java -

objective c - Ownership modifiers with manual reference counting -

python 3.x - Mapping specific letters onto a list of words -