184
I want to run a function just after the page loads in JavaScript. How can I do that?
The body tag has an attribute called onload which you can specify the function to run on page load
body
onload
<body onload="func()"> ... .. </body>