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

What am I missing?

It's saying the value of the input element is not being selected. What's 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

Steven Parker
Steven Parker
194,314 Points

This code is currently selecting the input element itself, but the challenge wants you to select the value (the ".value" attribute) of that element instead.

var inputValue = document.getElementById("linkName").value;

Thank you!

Dmitry Polyakov
Dmitry Polyakov
4,945 Points

You have to grab the value, so you need to append .value at the end

var inputValue= document.getElementById("linkName").value;

Thank you!