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 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
229,608 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