JavaScript JavaScript and the DOM Traversing the DOM Parent Traversal

Susan Stufflebean
Susan Stufflebean
7,466 Points

Cannot move on until I answer this question, please help?

I have located the previous answers to this question yet it will not work for me, any suggestions?

app.js
const removeMe = document.querySelector("remove_me");
var parent = removeMe.parentNode;
index.html
<!DOCTYPE html>
<html>
    <head>
        <title>Parent Traversal</title>
    </head>
    <link rel="stylesheet" href="style.css" />
    <body>
        <ul>
            <li>Hello</li>
            <li>Hi</li>
            <li class="remove_me">Good bye!</li>
            <li>Howdy</li>
        </ul>
        <script src="app.js"></script>
    </body>
</html>

1 Answer

Kieran Barker
Kieran Barker
14,971 Points

You're missing a dot before remove_me in your querySelector. It should be a class selector :)