Hello Reader's if you want to show the current timestamp on the web page by just a single click, Then by using JS you can do it.
Lets see the example below:-
<!DOCTYPE html>
<html>
<body>
<h1>My First JavaScript</h1>
<button type="button"
onclick="document.getElementById('demo').innerHTML = Date()">
Click me to display Date and Time.</button>
<p id="demo"></p>
</body>
</html>
Now as the page will load button will generate and on clicking that it will show the popup with current date and time.
0 Comment(s)