You can use the events named KeyBoard Events that are these:
The key event is sent to an element when the user presses a key on the keyboard. If the key is held down, the event is sent whenever the operating system repeats the key.
KEYDOWN EVENT JQUERY
The keypress event is sent to an element when the browser registers the keyboard input.
KEYPRESS EVENT JQUERY
The key event is sent to an element when the user releases a key on the keyboard.
KEYUP EVENT JQUERY
Below you can see an example using jQuery and the above events.
You can change the event to keypress or keydown
$(function(){
$('#teste').on('keyup',function(){
console.log(this.value);
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><inputtype="text" id="teste">