detect how a button was pressed in javascript -
detect how a button was pressed in javascript -
is there way observe how button pressed?
mouse clicked //mouse event highlighted via tab come in key //keypress event touched (mobile phones) //touch eventis there short javascript way observe this? or need add together event listeners click, enter, , touch? want info form submits. thanks
this how can handle
highlighted via tab come in key //keypress event
$('a').click(function(e) { console.log(e); // screen positions returns 0 on come in if( e.screenx == 0 && e.screeny == 0 ) { alert('enter'); } else if( e.type == "click" ) { alert('click'); } });
demo ofcause rest observe easily.
javascript
Comments
Post a Comment