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

Alexandru Pescaru
Alexandru Pescaru
5,223 Points

so guys is something wrong here ? i watched the video 5 times now.... what am i doing wrong ?

did i do something 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>

1 Answer

Daniel Jong
Daniel Jong
9,915 Points

You have to use .value to retrieve the value from the text input

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

Hope this helps!