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

var inputValue;
var a;

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

a.textcontent = inputValue
<!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

Heidi Fryzell
.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