HTML oninput Event Attribute Last Updated : 04 Aug, 2023 Comments Improve Suggest changes Like Article Like Report This attribute works when it gets user input value. This attribute mainly fires when the user change the value of <input> and <textarea> element. This attribute is quite similar to onchange attribute but the basic difference is that the oninput event attribute occurs immediately when the value of the element changes while the onchange attribute occurs when the element loses Focus. The other difference is that onchange attribute also works with the <select> element. Supported Tags: <input type="password"><input type="search"><input type="text"> <textarea>Syntax: <element oninput = "script">Attribute Value: This attribute contains value script and it works when oninput event triggered. This attribute is supported by many HTML tags: <input type="password">, <input type="search">, <input type="text"> and <textarea>. Example: HTML <!DOCTYPE html> <html> <head> <title>oninput attribute</title> <style> body { text-align: center; } h1 { color: green; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h2>oninput Attribute</h2> Enter some Text here: <input type="text" id="GFG" oninput="Geeks()"> <p id="sudo"></p> <script> function Geeks() { let x = document.getElementById("GFG").value; document.getElementById("sudo").innerHTML = "Entered Text: " + x; } </script> </body> </html> Output: Supported Browsers: The browser supported by oninput event attribute are listed below: Apple Safari 3.1Google Chrome 1Edge 79Firefox 6Opera 11.6Internet Explorer 9 Comment M manaschhabra2 Follow Improve M manaschhabra2 Follow Improve Article Tags : Misc Web Technologies HTML HTML-Attributes Explore HTML BasicsHTML Introduction5 min readHTML Editors5 min readHTML Basics7 min readStructure & ElementsHTML Elements5 min readHTML Attributes8 min readHTML Headings4 min readHTML Paragraphs5 min readHTML Text Formatting4 min readHTML Block and Inline Elements3 min readHTML Charsets4 min readListsHTML Lists5 min readHTML Ordered Lists5 min readHTML Unordered Lists4 min readHTML Description Lists3 min readVisuals & MediaHTML Colors11 min readHTML Links Hyperlinks3 min readHTML Images7 min readHTML Favicon4 min readHTML Video4 min readLayouts & DesignsHTML Tables10 min readHTML Iframes4 min readHTML Layout4 min readHTML File Paths3 min readProjects & Advanced TopicsHTML Forms5 min readHTML5 Semantics6 min readHTML URL Encoding4 min readHTML Responsive Web Design11 min readTop 10 Projects For Beginners To Practice HTML and CSS Skills8 min readTutorial ReferencesHTML Tags - A to Z List15+ min readHTML Attributes Complete Reference8 min readHTML Global Attributes5 min readHTML5 Complete Reference8 min readHTML5 MathML Complete Reference3 min readHTML DOM Complete Reference15+ min readHTML DOM Audio/Video Complete Reference2 min readSVG Element Complete Reference5 min readSVG Attribute Complete Reference8 min readSVG Property Complete Reference7 min readHTML Canvas Complete Reference4 min read Like