Quantcast
Channel: HighTechnology » Javascript
Viewing all articles
Browse latest Browse all 17

How to Show Date on button click through Javascript

$
0
0

Here is a example how to show the date when you click on the button through a javascript. Code:- <html> <head> <script type=”text/javascript”> function displayDate() { document.getElementById(“hightech”).innerHTML=Date(); } </script> </head> <body> <h1>My First Web Page</h1> <p id=”hightech”>Hightechnology.</p> <button type=”button” onclick=”displayDate()”>Display Date</button> </body> </html> Change accoding to your requirement.

The post How to Show Date on button click through Javascript appeared first on HighTechnology.


Viewing all articles
Browse latest Browse all 17

Trending Articles