Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • onreset event in Javascript

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 126
    Comment on it

    The onreset is used event when we want to reset a form.
    it allows users to clear checkboxes or input field which refreshes the whole form.

    Syntax
    onreset = "JavascriptCode"

    <!DOCTYPE html>
    <html>
    <head>
    <script>
    function sample() {
        alert("This alert box will trigger if u keep checkbox empty ");
    }
    </script>
    </head>
    <body>
    
    <form onreset="sample()">
    <label>Username</label>
    <input type="text" size="20">
    <label>Password</label>
    <input type="password" size="10">
    <input type="reset">
    </form>
    
    </body>
    </html>
    

 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: