Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4072528
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:53:47+00:00 2026-05-20T16:53:47+00:00

I a building a simple FAQ page on my site. I’d like the question

  • 0

I a building a simple FAQ page on my site. I’d like the question only to be visible, and once the user clicks on the question it should then show the answer. for some reason my code isn’t working. Please review my code and tell me what I am doing wrong.

html

<div class="copy" id="about1">
        <h1>The Mission</h1>
        <p>
            content content content

            content content content

            content content content

        </p>

  <h1>The Game</h1>
        <p>
            content content content

            content content content

            content content content

        </p>
 </div>

JS

$(document).ready(function() {
    $('.copy h1').onclick(function(){
          $('.copy p').hide();
        $('this').next('p').show();
    });
});

CSS

.copy p{
  display=none;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T16:53:48+00:00Added an answer on May 20, 2026 at 4:53 pm

    Two issues. First, in your JS, you’ve made two mistakes — onclick() should be click(), and you’ve wrapped this in single-quotes. It should read:

    $(document).ready(function() {
        $('.copy h1').click(function(){
          $('.copy p').hide();
          $(this).next('p').show();
        });
    });
    

    Second, in your CSS, the separator between keys and values should be a colon:

    .copy p {
        display: none;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Building a simple login page. If the user types in a password and password
I building a simple, 7 page, database driven, website, and I would like to
Im building a simple chat client which is only supposed to be able to
I'm building a simple chat app with Rails. when a user types in a
I'm building a simple audio player in AS3. I would like to embed multiple
I'm building a simple login system for the CI based site and I I'm
I am building a simple site with extJS. I can successfully attach click events
I'm building a simple multi-user (multi-tenant?) App with ASP.NET MVC3 and EF4, one database,
I am building a relatively simple Django application and apart from the main page
I'm building a simple accounting app to be used for personal finance. A user

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.