Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • HTML oninput event

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 64
    Comment on it

    This event will be fired when user enter an input. This event is mostly used with the input and textareat elements. This event is similar to onchange event. But there is a bit difference between them, oninput event will fired after the value of a element has changed, while onchange event will be fired when element loses it focus.
    Example :
    HTML Code :

    <!DOCTYPE html>
    <html>
    <body>
       <input type="text" id="myInput" oninput="oninputFunction()">
    <p id="demo"></p>
    </body>
    </html>
    

    Javascript Code :

    <script>
    function oninputFunction() {
        var x = document.getElementById("myInput").value;
        document.getElementById("demo").innerHTML = "You wrote: " + x;
    }
    </script>
    

    Output :
    As you write something in the text box, simultaneously it will display same text (due to oninput event ).

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: