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>