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
Post a Comment