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 Perfect

Second button/paragraph not showing up?

I followed the first step and everything looks the same, but when I preview it only shows the first button.

<p class="spoiler">
    <span>Luke and Leia are siblings! EW.</span>
</p>
$(".spoiler span").hide();

$(".spoiler").append("<button>Reveal Spoiler!</button>");

$("button").click(function(){
  $(".spoiler span").show();
  $(this).remove();
});

5 Answers

For me it was just a matter of the cache of my chosen browser (chrome) not being updated. Ensure that you've saved your workspace and then click preview and try F5 on the page (if its resilient you can always try Shift + F5 to ignore cached content when reloading). Best of luck!

I guess caching can be the issue. Refreshed lot of times but it still gv the same error. May be I shud try refreshing with cache !

Thanks for the info :)

Hi, I am facing the same issue !! Were u able to solve it ?

I forget now, but I'm pretty sure I went back to it and it worked for no reason. I had the same problem on the next project too.

Thank You Daniel. Will c it once more.

Thank you for the answer, I also have to refresh browser with Shift + F5 to show two paragraphs.

I had the same issue. It worked when I added this to the html:

<p class="spoiler"> <!---Spoiler:--> <span>Luke and Leia are siblings. Ew.</span> </p>