JavaScript JavaScript and the DOM Traversing the DOM Parent Traversal

what am I doing wrong?

what am I doing wrong?

var removeMe = document.querySelector('.remove_me');

const removeMe = document.querySelector('.remove_me');
let parent = removeMe.parentNode;
<!DOCTYPE html>
        <title>Parent Traversal</title>
    <link rel="stylesheet" href="style.css" />
            <li class="remove_me">Good bye!</li>
        <script src="app.js"></script>

2 Answers

Jeremy Canela
Jeremy Canela
Full Stack JavaScript Techdegree Graduate 24,170 Points

Hey Kim, you have two variables with the same name. If you look at the console it says:

Uncaught SyntaxError: Identifier 'removeMe' has already been declared

Removing the first 'var' should solve your issue.

thank you Jeremy canela