on page load execute function js code example
Example: javascript execute code on page load
<html>
<body onload="loaded();"></body>
<script>
function loaded() {
alert('Page is loaded');
}
</script>
</html>
<html>
<body onload="loaded();"></body>
<script>
function loaded() {
alert('Page is loaded');
}
</script>
</html>