
Azzie Fuzzie
6,537 PointsGet element by ID
Hi,Whats the mistake?
var inputValue = document.getElementById('linkName');
<!DOCTYPE html>
<html>
<head>
<title>DOM Manipulation</title>
</head>
<link rel="stylesheet" href="style.css" />
<body>
<div id="content">
<label>Link Name:</label>
<input type="text" id="linkName">
<a id="link" href="https://teamtreehouse.com"></a>
</div>
<script src="app.js"></script>
</body>
</html>
1 Answer

Gergely Bocz
Treehouse Moderator 13,345 PointsHi Azzie Fuzzie!
You have to get the value of the input and not the input element itself,
Try this:
var inputValue = document.getElementById('linkName').value;