1 Answers

Sanat Shukla
Sanat Shukla

This is the smallest program in javascript for getting DateTime.

<!DOCTYPE html>

<html>
<body>

<h2>My First JavaScript</h2>

<button type="button" onclick="document.getElementById('demo').innerHTML = Date()">Click me</button>

<p id="demo"></p>

</body>
</html>

Answer