Definition
Once a page has been loaded 'onload' event executes a JavaScript immediately.
We can use onload function in number of ways:
1. <body onload="load1()">
2. <element onload="SomeJavaScriptCode">
3. object.onload="SomeJavaScriptCode"
4. window.onload = load;
function load1() {
alert("This is the first.");
}
<frameset onload="framload()">
Once a page has been loaded 'onload' event executes a JavaScript immediately.
We can use onload function in number of ways:
1. <body onload="load1()">
2. <element onload="SomeJavaScriptCode">
3. object.onload="SomeJavaScriptCode"
4. window.onload = load;
function load1() {
alert("This is the first.");
}