window.onload will work like this:
function codeAddress() {_x000D_
document.getElementById("test").innerHTML=Date();_x000D_
}_x000D_
window.onload = codeAddress;
_x000D_
<!DOCTYPE html>_x000D_
<html>_x000D_
<head>_x000D_
<title>learning java script</title>_x000D_
<script src="custom.js"></script>_x000D_
</head>_x000D_
<body>_x000D_
<p id="test"></p>_x000D_
<li>abcd</li>_x000D_
</body>_x000D_
</html>
_x000D_