3.1 What is React?

Start with vanilla JavaScript

# Background

Create a simple "Hello World" HTML5 application with modern JavaScript. The index.html file has been provided to get you started. It has an empty <div> with the id of root. This is the container element that will hold all of the application generated content.

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Hello React</title>
    <style>
      .container {
        font-size: 2rem;
      }
    </style>
  </head>
  <body>
    <div id="root"></div>
  </body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

# Requirements

  • Add a JavaScript block at the bottom of the <body> element.
  • Using only plain JavaScript:
    • create a new <p> containing the text "Hello World"
    • add the class name "container" to this <p> element
    • append this new <p> to the #root element
Last Updated: : 9/21/2021, 10:08:13 AM