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

Daniel Evans
Daniel Evans
5,105 Points

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!

Purvi Agrawal
Purvi Agrawal
7,960 Points

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 :)

Purvi Agrawal
Purvi Agrawal
7,960 Points

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

Daniel Evans
Daniel Evans
5,105 Points

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.

Purvi Agrawal
Purvi Agrawal
7,960 Points

Thank You Daniel. Will c it once more.

Aleksander Gebicki
Aleksander Gebicki
5,489 Points

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

Learning coding
seal-mask
.a{fill-rule:evenodd;}techdegree
Learning coding
Front End Web Development Techdegree Student 9,937 Points

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>