Web Tools Table Maker3schools TranslateImage CompressorFavicon Icon GeneratorCrop & Resize Image
Apu
Apu March 05, 2023 › #HowTo #Javascript

How do you write Hello World in an alert box in JavaScript?


[A] alert = "Hello World"
[B] alertBox("Hello World")
[C] alert("Hello World")
[D] window.alert("Hello World")

The correct answer is C) alert("Hello World").

<script>
  alert("Hello World")
</script>

This code will display a pop-up window with the message "Hello World". It is a useful way to notify the user of important information, such as an error message or a warning.

save
listen
AI Answer
Write Your Answer
loading
back
View All