Category Archives: Javascript

How to create a alert box in html through javascript

How to create a alert box in html through javascript In html through javascript you can also use alert message by the sample code present below.It is easy to use and also easy to edit. Code:- <html> <head> <script type="text/javascript"> function alert() { alert("Hightechnology!"); } </script> </head> <body> <input type="button" onclick="alert()" value="Hightechnology" /> </body> </html>

How to Show Date on button click through Javascript

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.