DOM - Input Event

Table of Contents

About

The input event fires when the value has changed of one of this input element:

Demo

input

With an input

  • The HTML
<input type="text">
  • The javascript
document.querySelector("input").addEventListener("input", function(){
   console.log("The input event has fired for the value: "+this.value);
});
  • Result: Type a text in the input box and see the log of values

Powered by ComboStrap