Exercise: DOM Manipulation
- You should add your solution to the assignments folder (DOM Manipulation) – Week5 repo
Let’s start preparing the structure of our files:
-
create 2 files with .js and .html extensions.
-
Create the basic template for your html file.
-
Link your files together using <script> tag.
-
In your .js file do the following:
- Create a
<p>
with red text that says "Hey I’m red!" and add it to the document’s body - Create and add an
<h3>
with blue text that says "I’m a blue h3!" - Create and add a
<div>
with a black border and pink background color with the following elements inside of it:- another
<h1>
that says "I’m in a div" - a
<p>
that says "ME TOO!" - Hint for this one: after creating the div with createElement, append the
<h1>
and<p>
to it before adding it to thedocument.body
.
- another
- Create a
-
Push your solution, create a pull request and submit the pull request URL to the Quiz below.