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

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 201
    Comment on it

    This event is fired when an object has been loaded. This event is used mostly with the body element to execute a script, after the page loaded all content (including images, script files, CSS files, etc.), this event will be fired. It also help users to deal with the cookies.
    Syntax

    <element onload="script">
    

    Attribute value :
    script : This script will be run on onloaded.
    Example :
    HTML Code :

    <html>
    <head>
    </head>
    <body onload="onloadFunction()">
    <h1>Hello World!</h1>
    </body>
    </html>
    

    javascript code :

    <script>
    function onloadFunction() {
        alert("Page is loaded");
    }
    </script>
    

    Output :
    Alert-box will pop-up with message "Page is loaded"

 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: