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

Jason Widjaja
Jason Widjaja
7,904 Points

how to do this

idk what to do here pls help

app.js
var inputValue;
var a;

inputValue = document.getElementById("linkName").value
a = document.querySelector("a")

a.textcontent = inputValue
index.html
<!DOCTYPE html>
<html>
    <head>
        <title>DOM Manipulation</title>
    </head>
    <link rel="stylesheet" href="style.css" />
    <body>
        <div id="content">
            <label>Link Name:</label>
            <input type="text" id="linkName">
            <a id="link" href="https://teamtreehouse.com"></a>
        </div>
        <script src="app.js"></script>
    </body>
</html>

1 Answer

Heidi Fryzell
seal-mask
MOD
.a{fill-rule:evenodd;}techdegree seal-36
Heidi Fryzell
Front End Web Development Treehouse Moderator 21,229 Points

Hi Jason,

The issue is in this line:

a.textcontent = inputValue

The textContent property needs to be in camelCase. So if you capitalize the "C" in content, it should work.

a.textContent = inputValue