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 8531991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:36:38+00:00 2026-06-11T09:36:38+00:00

Problem in short: I’m trying to make a simple show/hide toggle work on just

  • 0

Problem in short: I’m trying to make a simple show/hide toggle work on just the element you click on, while right now all (13) divs get affected by the function.

Structure of each div looks like this

<div class="selectbox">
    <h5>Title</h5>
    <p>
        Content
    </p>
</div>

With this jquery code

$('.selectbox h5').click(function(){
         $('div.selectbox,p,span').toggle();
         $('.selectbox').toggle();
    });

So right now, the jquery works. But obviously, does its work on every “selectbox” div on the page. How can I make this work on just the element I click on, without using a unique id for every “selectbox” div?

  • 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-06-11T09:36:40+00:00Added an answer on June 11, 2026 at 9:36 am
    $('.selectbox h5').click(function(){
         $(this).parent().find('p,span').toggle(); 
         $(this).parent().toggle(); // this line should probably be removed 
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Short problem description: XCode 4.2 install right Target on device, but debug (run) always
Long story short I am trying to replicate the Sleeping barber problem in Erlang.
The Problem I'm trying to play a short (4 second) audio clip in an
Problem Can't get prependTo() and slideDown() functions work together. Short Please take a look
Short version of my problem: I cannot figure out how to make the action
I'm trying to figure out the problem in this short paragraph of code. Any
In short, I'm trying to learn a bit of Spring. Problem is, when I
I'm facing this problem (i'll make it short and easy) In form1 i need
So the wonderful low down on this doozie of a problem: short version: We
Problem in short: How could one implement static if functionality, proposed in c++11, in

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.