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

Laura Arias
Laura Arias
4,620 Points

it says I am selecting the wrong element

I am getting the element through its id. It says I am wrong

var inputValue = document.getElementById("linkName");
<!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>

2 Answers

Clayton Perszyk
Clayton Perszyk
Treehouse Moderator 46,159 Points

You need the elements value. you can access it with .value.