Javascript examples for DOM Event:addEventListener
The oninput event occurs when an element gets user input.
Bubbles | Yes |
---|---|
Cancelable | No |
Supported HTML tags: | <input type="color">, <input type="date">, <input type="datetime">, <input type="email">, <input type="month">, <input type="number">, <input type="password">, <input type="range">, <input type="search">, <input type="tel">, <input type="text">, <input type="time">, <input type="url">, <input type="week"> and <textarea> |
<!DOCTYPE html> <html> <body> Enter name: <input type="text" id="myInput" value="Mickey"> <script> document.getElementById("myInput").addEventListener("input", myFunction); function myFunction() {//w w w . java2s .c om console.log("The value of the input field was changed."); } </script> </body> </html>