how to have a key press as an input in javascript code example Example: html onkeypress <input type="text" onkeypress="myFunction()">