JavaScript - Programming Language (MCQ) questions for Q. 27561

Q.  The following is a web-page:

<html>
     <head> <title>JavaScript</title> </head>
      <body bgcolor=""#0000ff"">
          <script language=""JavaScript"">
               <!-- document.write(""<h1> hello world </h1>""); //-->
          </script>
     </body>
</html>

When the above web page is loaded into a browser, what will happen?

- Published on 26 Feb 17

a. The body of the web page will not contain any text
b. The body of the web page will contain the text “hello world” as an H1 heading
c. The background color of the web page will be green
d. document.write("<h1> hello world </h1 >”); is a comment.

ANSWER: The body of the web page will not contain any text

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)