keydown and keyup in javascript code example
Example 1: javascript on keypu
<input type="text" onkeyup="myFunction()">
Example 2: jquery keyup
// Similar to KeyUp but just called on input change (optimal for AJAX calls)
var input = $('#formID').find('input[type="text"]');
input.on('input',
function(){
console.log (input.val());
});