Alert Box Using JavaScript The below code will demo used to display the alert message to user on the browsers window. <html> <head> <script type = "text/javascript" > function sayHello () { alert ( "Hello World" ) } </script> </head> <body> <input type = "button" onclick = " sayHello () " value = "Say Hello" /> </body> </html> Once the say hello button is clicked the alert will be shown with the defined messages on the browsers. Output: It will display the hello world with alert box.! Thanks and Regards, Tech bird