Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript jQuery Basics (2014) Creating a Spoiler Revealer Perform: Part 2

mine is cool!!

$(".spoiler").hide().show(": button");

This is what I came up with when looking at the API it does work, it hides the button while showing the spoiler!!!

2 Answers

Steven Parker
Steven Parker
221,328 Points

At first glance, it looks like it might do the opposite: hide the spoiler but show the button.

However, I'm confused by a couple of things:

  • the selector ": button" doesn't look like a valid selector.. Is the space a typo?
  • the API indicates that a string argument to show is duration, not a filter selector.

So if the argument is being disregarded, then the spoiler class is being hidden and then immediately shown. That would explain "show the spoiler". But I can't see how this would hide the button.

ur stupid