onkeyup and onkeydown code example
Example 1: javascript onkeydown
<input type="text" onkeydown="myFunction()">
Example 2: onkeyup in javascript
<input type="text" onkeyup="myFunction()"> //Or your Code
Example 3: onkeyup
A function is triggered when the user releases a key in the input field