JavaScript JavaScript Basics (Retired) Introducing JavaScript Your First JavaScript Program

Tonya Davis
Tonya Davis
1,313 Points

Add code inside the <script> tags to write the words "Welcome to my site" onto the web page.

what am I doing wrong?

index.html
<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
</head>

<body>
</body>

<script> "Welcome to my site"</script>

</html>

Hey Tonya!

You need to use document.write() to print the message to the web page.

<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
</head>

<body>
</body>

<script>

  document.write('Welcome to my site');

</script>

</html>

I hope this helps :)

1 Answer