With
the alert box displays the value in the box, not included the current key dep
First thing is avoid using js code inside html tags it is a bad practice , you can use the keyup event to get the content of the input after the user release any pressed key