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

Siddharth Pandey
Siddharth Pandey
4,184 Points

Why doesn't this work:

Code: I typed in var inputValue = document.getElementById('linkName');

But the program still says I am wrong.

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

1 Answer

They want you to get the value of what is stored in the input;

var inputValue = document.getElementById('linkName').value;
Siddharth Pandey
Siddharth Pandey
4,184 Points

Thanks, yeah, now I see where I was going wrong.