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

var inputValue; inputValue = document.getElementById('linkName'); is there anything wrong this code cause it fails me

I don't see where I'm wrong.

app.js
var inputValue;
inputValue = document.getElementById('linkName');
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

Steven Parker
Steven Parker
203,729 Points

The instructions ask you to get the value (attribute) of the selected element, not the element itself.