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

Seth Lewis
seal-mask
.a{fill-rule:evenodd;}techdegree
Seth Lewis
Full Stack JavaScript Techdegree Student 7,660 Points

STUCK - not selecting <a> tag??

I don't understand how the querySelector is not selected the <a> tag. I am targeting the specific ID and I am assigning its text content to the inputValue variable.

Please help. Thank you.

app.js
var inputValue = document.querySelector('#linkName').value;

document.querySelector('#link').textConent = 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

Phil Livermore
Phil Livermore
11,016 Points

Check your spelling of textContent.