js addeventlistener to input code example
Example 1: on change event html not working
onchange is only triggered when the control is blurred. Try onkeypress instead.
Example 2: mdn select event
<input value="Try selecting some text in this element.">
<p id="log"></p>