Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript and the DOM (Retiring) Making Changes to the DOM Changing Element Attributes

Sascha Lamparter
seal-mask
PLUS
.a{fill-rule:evenodd;}techdegree seal-36
Sascha Lamparter
Front End Web Development Techdegree Graduate 15,570 Points

Challenge: Modifying Elements

for the first Task in the challenge I am recieving the message: You did not target the value. Here is my code:

let inputValue = document.querySelector('#linkName');

Can somebody please help me?

Thanks Sascha

4 Answers

Hey!

So, your code is absolutely correct. The issue is that the task wants you to store the /value/ of the input element in the inputValue variable. To get an input's value you need to use the ".value" method. Which is exactly what your code is missing. It should be like this:

let inputValue = document.querySelector("#linkName").value;

Hope this helps. Good luck with coding :)

Hey, Sascha!

Check this page for more info on how to display your code in posts: https://teamtreehouse.com/community/posting-code-to-the-forum . It's explained in detail + examples :)