0 votes
91 views
in Computer Science by (33.3k 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 (268k 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>
...