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

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -