Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Writing into an Alert Dialog Box with JavaScript</title> </head> <body> <script> // Displaying a simple text message alert("Hello World!"); // Outputs: Hello World! // Displaying a variable value let x = 10; let y = 20; let sum = x + y; alert(sum); // Outputs: 30 </script> </body> </html>