Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

JavScript level 10 lesson 1 Answer not accepting!

Question:
We have added some HTML code in the editor. You have to use the document.write() function to add a heading <h1> to the page. The text of the heading should be: Hello World.

Sol.:
<!doctype html>
<html>
<head>
<title>JS with HTML</title>
</head>
<body>

<script>
document.write(`<h1>Hello World<h1>`);
</script>

</body>
</html>
by

3 Answers

Sanju3399
Try this

<!doctype html>
<html>
<head>
<title>JS with HTML</title>
</head>
<body>

<script>
document.write("<h1>Hello World<h1>");
</script>

</body>
</html>
shubhamprkash
still the same error on submitting " We cannot see the cod to include a heading in HTML." .????????????
synthlearn
Try document.write("<h1>Hello World</h1>"); with the added forward slash on the second tag.

Login / Signup to Answer the Question.