how to invoke a function in javascript as the html page loads code example Example: how to call a function as soon as a page loads javascript <body onload="yourFunction()"> </body>