JavaScript JavaScript and the DOM Making Changes to the DOM Modifying Elements

Zenzi Ali
Zenzi Ali
Courses Plus Student 2,412 Points

I'm looking for some general help

I've been working on the Full Stack track and hit a roadblock. I'm unable to successfully manipulate the Dom. I've been stuck in this section for over a week. I watch a section, attempt an exercise or quiz, and fail. I'm truly lost. I've been in a failure loop! The only reason I've completed any sections at all is that others have helped me. I don't even know what I'm not getting or what to do. Has this happened to anyone else? What should I try now?

var inputValue = input.value(
<!DOCTYPE html>
        <title>DOM Manipulation</title>
    <link rel="stylesheet" href="style.css" />
        <div id="content">
            <label>Link Name:</label>
            <input type="text" id="linkName">
            <a id="link" href=""></a>
        <script src="app.js"></script>

1 Answer

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 87,013 Points

Hi Zenzi.

It’s unfortunate you’re feeling like this. We all go through these moments so know that you’re not alone on that score.

Manipulating the DOM works in stages. You first select the element in JavaScript and then make the code listen for something called an event so it can then perform an action on it.

Just keep going back through the course which will give you all the information you need about how to select elements and listen for actions so the DOM can be changed.

Hint... look for things like document.getElementById andaddEventListener to get you started. These are the core methods of DOM scripting.