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

Lucas Bryce
PRO
Lucas Bryce
Pro Student 4,510 Points

What am I doing wrong?

help pls

app.js
var 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

<noob />
<noob />
16,621 Points

Your’e very close. right now you are selecting the input element but in order to select the content inside the input element u need to add the keyword “value”. so it’s document.getElementById(“linkname”).value;