js key event text input code example Example: html onkeypress <input type="text" onkeypress="myFunction()">