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 1

Ashok Anumandla
Ashok Anumandla
2,163 Points

hide() is not working in my browser(chrome)...

hide() method is working fine in firefox..!! Is it cross browser compatibility issue?? What is the solution?? Please help me...!!!

Colin Marshall
Colin Marshall
32,861 Points

This should work in Chrome. Please provide us with your code so we can help you out. Check the Markdown Cheatsheet for info on how to post code to the forum. (linked under the text area where you type a reply to a post).

3 Answers

It is not working in my chrome browser as well. Any solutions?

Colin Marshall
Colin Marshall
32,861 Points

Is it not working on all elements or only specific elements? If you could provide a snapshot from Workspaces, a jsFiddle, or a CodePen of a non-working example I will have a look for you.

Martin Awano
Martin Awano
5,092 Points

I'm having a similar problem. When I append the new button, all that happens is that the $(".spoiler span").hide(); command seems to go away and I see the spoiler but no button on top of it. I'm working in chrome as well.

Working on my own website, I noticed that the hide() function isn't working at all. I tried using:

$(document).ready(function(){ $('.test span').hide(); });

But it hasn't worked. Any idea why I'm having trouble?

Ali Raza
Ali Raza
13,633 Points
// 1. preparation 2. plan 3. perform. 4. perfect
// hide the spoiler and then reveal them through user interaction

//1. prepration: hide the span element aka spoiler

$(".spoiler span").hide();

//2. add a button
// 3. when button pressed
  // 3.1. show spoiler
  // 3.2. get rid of a button
Ali Raza
Ali Raza
13,633 Points

Hide function is not working in chrome for some reason.