0 votes
57 views
in Computer Science by (31.5k points)
Write a function in JavaScript to display the current date on the web page as soon as the page is loaded.

1 Answer

0 votes
by (251k points)
 
Best answer
<html><head><script>

function myFunction()

{ var d=new Date();

 document.write ( d );

}

</script>

</head>

<body onload="myFunction()">

<h1>Event handling!</h1>

</body>

</html>
...