What will be displayed in the browser page when the following code is…

2018

What will be displayed in the browser page when the following code is included?

<html>

<body>

<script type="text/javascript">

document.write("Hello World!")

</script>

</body>

</html>

Answer: A. Hello World!The JavaScript statement document.write("Hello World!") writes Hello World! into the web page, so the browser displays Hello World!.

  1. A.

    Hello World!

  2. B.

    document.write("Hello World!")

  3. C.

    "Hello World!"

  4. D.

    Nothing will be displayed

Attempted by 47 students.

Show answer & explanation

Correct answer: A

The JavaScript statement document.write("Hello World!") writes Hello World! into the web page, so the browser displays Hello World!.

Explore the full course: Uppsc Polytechnic Lecturer 2025 Cs

Loading lesson…