UK ['ɒnləʊd] US ['ɒnloʊd]

vt.Loading

javascript onload attribute syntax

Function: Occurs immediately after the page or image is loaded.

Syntax: onload="SomeJavaScriptCode"

Parameters: SomeJavaScriptCode Required. Specifies the JavaScript to be executed when this event occurs.​

javascript onload attribute example

<html>
<head>
<script type="text/javascript">
function load()
{
//在页面完成加载时在状态栏显示一段文本。
window.status="Page is loaded"
}
</script>
</head>

<body onload="load()">
</body>

</html>

Run instance »

Click the "Run instance" button to view the online instance