javascript - How to check state onKeypress -
i have simpy question..
how can take state key (keydown, keyup) in onkeypress in javascript?
document.onkeypress = function() { console.log(/* state (down or sometihn this*/) }
and if have 2 functions? (up , down)
document.getelementbyid('my').onkeydown = function() { alert('down'); } document.getelementbyid('my').onkeyup = function() { alert('up'); }
Comments
Post a Comment