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 trialZoltán Levente Papp
3,045 PointsI was following the teacher's activity in my workspace and none of them worked for me like in the video.Version?
1. const box = document.querySelector(".box"); box.style.display = "none";
The box disappeared in about a second later
2. $('.box).hide();
The box remained there. No change on the site.
3 Answers
darryn
17,367 PointsHi Zoltan,
For #1 I don't think JavaScript can hide anything until the entire page loads. That's why you see the box flash before it disappears.
For #2 it just looks like you didn't close the single quotes around the box class. A simple typo that we all make.
Steven Parker
231,275 PointsWhen you say "about a second later", do you mean a second after you refreshed your browser?
The workspace provide a way to create code for your browser, but changes made there will not be visible on their own. You can only see the results of code changes by first saving the file and then refreshing your browser.
Zoltán Levente Papp
3,045 PointsYes, Steve. After saving the app.js and refreshing the browser or hitting the preview button the box is there. And then a miracle happens and disappears.
Steven Parker
231,275 PointsWe might be able to uncover the mystery if you make a snapshot of your workspace and post the link to it here.
darryn
17,367 PointsYeah. Thanks, Steven! Looking forward to when you hit 100k :0)
Steven Parker
231,275 PointsWell, I seem to have done it. But now I've discovered a new bug:
Steven Parker
231,275 PointsSteven Parker
231,275 PointsGood eye! No wonder your avatar is an eagle!
Zoltán Levente Papp
3,045 PointsZoltán Levente Papp
3,045 PointsThanks a lot! That was the problem...