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 Styling Elements

The hide button isn’t working

I followed the steps exactly, but my button doesn’t hide the list. For me, the “=>” in the function is orange instead of black like in the video. Does that make a difference? Thanks.

Quinton Shuman
Quinton Shuman
7,068 Points

I believe the orange is just how the text editor they give you indicates to you that it is a function.

Post the snippet of the whole code, you might have missed something trivial (as I do very often :D ).

1 Answer

Same issue too!

const toggleList = document.getElementById('toggleList'); const listDiv = document.querySelector('.list'); const input = document.querySelector('input'); const p = document.querySelector('p.description'); const button = document.querySelector('button');

toggleList.addEventListener('click', () => { listDiv.style.display = 'none'; });

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

under my addEvent it is not showing up as the same color as the rest of the line.