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

I don't Know How to Solve This

I don't understand how can I use getElementById, and select input?

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

Romain Gaget
Romain Gaget
24,448 Points

You'll need to add the value property at the end to get an input field value:

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