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>

# Requirements

  • Add a JavaScript block at the bottom of the <body> element.
  • Using only plain JavaScript:
    • create a new <div> containing the text "Hello World"
    • add the class name "container" to this <div> element
    • append this new <div> to the #root element
Last Updated: : 9/23/2020, 11:49:32 AM