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

Sezare Miguel
Sezare Miguel
9,229 Points

What is the input value?

Please help?

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

Steven Parker
Steven Parker
203,717 Points

The input value can be accessed through the "value" attribute of the selected element:

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