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

Cooper Lyson
Cooper Lyson
235 Points

Challenge Task 1 of 1 of JavaScript Basics

How do you add code into the <script> and document.write "welcome to my site"?

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

<body>
  //document.write("<h1>Welcome to my site</h1>")

</script>

</html>

1 Answer

Edwin Rivera
Edwin Rivera
4,541 Points

Make sure you write your code inside the script tag example:

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

<body>
  <script>
      document.write("<h1>Welcome to my site</h1>")
  </script>
</body>

</html>