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

Ok im not sure why i kep getting error in app.js line 6.

const input = document.querySelector('ínput');  // í instead of i due to which you are getting typeError in console
const p = document.querySelector('p.description');
const button = document.querySelector('button');

button.addEventListener('click', () => {
  p.textContent = input.value;
});

2 Answers

Steven Parker
Steven Parker
243,656 Points

Boy, you got a weird one here!

So on this line:

const input = document.querySelector('ínput');  // í instead of i ...

What looks like the letter "i" in "input" is actually a Unicode U+00ED, also known as a "Latin small letter i (U+0069) combining acute accent (U+0301)". This causes the querySelector to fail and the variable input to get assigned with a null. And, of course, trying to get the value property of null will produce an error.

But based on your code comment, you already knew that word was not "input", right?

woah im not sure how that 'i' became like that. anyways thanks! :)