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

Stellah Avanthi
Stellah Avanthi
Full Stack JavaScript Techdegree Student 5,934 Points

Select the <input> element with the ID linkName and store its value in the variable inputValue.

The quiz does not evaluate my answer correctly. Not able to get what else needs to be done.

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

Dimitar Dimitrov
Dimitar Dimitrov
10,298 Points

linkName is a input element so you can store its value(text, number etc ) with .value

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