JavaScript JavaScript and the DOM Making Changes to the DOM DOM Manipulation

Lucas Bryce
PRO
Lucas Bryce
Pro Student 4,510 Points

need help

help

app.js
var contentDiv = document.getElementById('content');
var newParagraph = document.createElement('p');
newParagraph = 
index.html
<!DOCTYPE html>
<html>
    <head>
        <title>DOM Manipulation</title>
    </head>
    <link rel="stylesheet" href="style.css" />
    <body>
        <div id="content">

        </div>
        <script src="app.js"></script>
    </body>
</html>

1 Answer

anthony amaro
anthony amaro
8,166 Points

hello lucas.. as the question says it wants you to add a class to the paragraph you created

element.classList.add('nameOfClass'); // to add classes
element.classList.remove('nameOfClass'); // to remove classes

hope this helps