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 trialJenna Malone
7,173 PointsWhy not just use .hide(); ?
So previously we used .hide(); to hide the text box that flew in in the first project. I am just wondering why for this project we want to actually remove it from the DOM instead of just hiding it? Is there a best practices thing that I am missing here, or are we just removing it from the DOM because thats what the instructor specifically told us to do?
1 Answer
David Gross
19,443 Pointshide() sets the matched elements' CSS display property to none.
remove() removes the matched elements from the DOM.
Jenna Malone
7,173 PointsJenna Malone
7,173 PointsThat makes sense, thank you!