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

Prabhakar R
Prabhakar R
1,964 Points

what is the answer.

I am selection element by ID but it's not working.

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>
Prabhakar R
Prabhakar R
1,964 Points

sorry, It's not selection it's selecting*

1 Answer

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 50,936 Points

You need the value of the element. Try adding .value to the end of your selection,