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
    • 140
    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>
       <input type="text" id="myInput" oninput="oninputFunction()">
    <p id="demo"></p>

    Javascript Code :

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

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

 0 Comment(s)

Sign In

Sign up using

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: