I want a JavaScript function to execute on page load.
I added an attribute onload to the tag <form> but it alert fails.
onload
<form>
alert
What am I doing wrong?
<form name=myfm method=post action=quiz.php onload = alert('hello')>
try adding onload to tagbody
body
<body onload="alert('Hello World')">
// javaScript window.onload = function{ alert("loaded"); } // jquery $(document).ready(function() { $("#div-id").click(function(){ alert("the page is loaded"); }); });