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!.
- A.
Hello World!
- B.
document.write("Hello World!")
- C.
"Hello World!"
- 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!.
Loading lesson…