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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:29:24+00:00 2026-05-22T17:29:24+00:00

When i click in a link all the divs with the relevant classes open

  • 0

When i click in a link all the divs with the relevant classes open and close.

How do I apply the .this function to the jquery?
i
This is the code I have, I would only like to activate the the one that is clicked

$(document).ready(function(){   
    //On Click
    $('.collapseLink').click(function(){
        $('.revealBoxContents').stop(true, true).slideToggle('slow');
    });
});

here is the html unfortunatly I am not allowed to change this markup

<div class="revealBox revealBoxClosed">
            <div class="revealBoxTop">
                <h3>About You</h3>
           <a class="collapseLink" title="" href="javascript:void(0);"><span class="dottedBot">Hide information</span><img width="16" height="16" class="detailListActions" alt="-" src="Resources/Images/BBG/main/minus.gif"></a>              </div>
            <!-- /revealBoxTop -->
         <div class="revealBoxContents" style="display: block;">
           <div class="detailListHead pad10">
              <span class="floatLeft">Details about you </span>
             <span class="floatRight">Edit</span>
             <div class="clearBoth"></div>
           </div>

            <ul class="revealDetailsList">
              <li class="table shadedList ">
             <div class="tableRow">
              <span class="detailCell detailLabel">Your Name:</span>
              <p class="detailResult">Mr John Smith</p>
             <a class="detailCell detailListActions" title="" href="javascript:void(0);"><img width="16" height="16" alt="?" src="Resources/Images/BBG/main/iconq.gif"></a>

             </div><!-- /tableRow -->
                          </li>
              <li class="table">
             <div class="tableRow">
              <span class="detailCell detailLabel">Gender:</span>
              <p class="detailResult">Male</p>
             <a class="detailCell detailListActions" title="" href="javascript:void(0);"><img width="16" height="16" alt="?" src="Resources/Images/BBG/main/iconq.gif"></a>
             <a class="detailCell detailListActions" title="" href="javascript:void(0);"><img width="16" height="16" class="marginRight10" alt="Edit" src="Resources/Images/BBG/eqs/edit.gif"></a>
             </div><!-- /tableRow -->
                            </li>
              <li class="table shadedList ">
             <div class="tableRow">
              <span class="detailCell detailLabel">Date of Birth:</span>
              <p class="detailResult">11/11/1977</p>
             <a class="detailCell detailListActions" title="" href="javascript:void(0);"><img width="16" height="16" alt="?" src="Resources/Images/BBG/main/iconq.gif"></a>
             <a class="detailCell detailListActions" title="" href="javascript:void(0);"><img width="16" height="16" class="marginRight10" alt="Edit" src="Resources/Images/BBG/eqs/edit.gif"></a>
             </div><!-- /tableRow -->
                            </li>
              <li class="table">
             <div class="tableRow">
              <span class="detailCell detailLabel">Postal Address:</span>
              <p class="detailResult">1 Buchanan Street, Derby, Derbyshire, DE1 3BZ 1 Buchanan Street, Derby, Derbyshire, DE1 3BZ</p>
             <a class="detailCell detailListActions" title="" href="javascript:void(0);"><img width="16" height="16" alt="?" src="Resources/Images/BBG/main/iconq.gif"></a>
             <a class="detailCell detailListActions" title="" href="javascript:void(0);"><img width="16" height="16" class="marginRight10" alt="Edit" src="Resources/Images/BBG/eqs/edit.gif"></a>
             </div><!-- /tableRow -->
                            </li>
              <li class="table shadedList ">
             <div class="tableRow">
              <span class="detailCell detailLabel">Relationship Status:</span>
              <p class="detailResult">Married</p>
             <a class="detailCell detailListActions" title="" href="javascript:void(0);"><img width="16" height="16" alt="?" src="Resources/Images/BBG/main/iconq.gif"></a>
             <a class="detailCell detailListActions" title="" href="javascript:void(0);"><img width="16" height="16" class="marginRight10" alt="Edit" src="Resources/Images/BBG/eqs/edit.gif"></a>
             </div><!-- /tableRow -->
                            </li>
              <li class="table">
             <div class="tableRow">
              <span class="detailCell detailLabel">Daytime/Mobile Telephone:</span>
              <p class="detailResult">01977 123245</p>
             <a class="detailCell detailListActions" title="" href="javascript:void(0);"><img width="16" height="16" alt="?" src="Resources/Images/BBG/main/iconq.gif"></a>
             <a class="detailCell detailListActions" title="" href="javascript:void(0);"><img width="16" height="16" class="marginRight10" alt="Edit" src="Resources/Images/BBG/eqs/edit.gif"></a>
             </div><!-- /tableRow -->
                            </li>
              <li class="table shadedList ">
             <div class="tableRow">
              <span class="detailCell detailLabel">Email Address:</span>
              <p class="detailResult">john.smith@email.com</p>
             <a class="detailCell detailListActions" title="" href="javascript:void(0);"><img width="16" height="16" alt="?" src="Resources/Images/BBG/main/iconq.gif"></a>
             <a class="detailCell detailListActions" title="" href="javascript:void(0);"><img width="16" height="16" class="marginRight10" alt="Edit" src="Resources/Images/BBG/eqs/edit.gif"></a>
             </div><!-- /tableRow -->
                            </li>
              <li class="table">
             <div class="tableRow">
              <span class="detailCell detailLabel">Date you wish your insurance to start:</span>
              <p class="detailResult">2/03/2011</p>
             <a class="detailCell detailListActions" title="" href="javascript:void(0);"><img width="16" height="16" alt="?" src="Resources/Images/BBG/main/iconq.gif"></a>
             <a class="detailCell detailListActions" title="" href="javascript:void(0);"><img width="16" height="16" class="marginRight10" alt="Edit" src="Resources/Images/BBG/eqs/edit.gif"></a>
             </div><!-- /tableRow -->
                            </li>
              <li class="table shadedList ">
             <div class="tableRow">
              <span class="detailCell detailLabel">Employment Status:</span>
              <p class="detailResult">Employed</p>
             <a class="detailCell detailListActions" title="" href="javascript:void(0);"><img width="16" height="16" alt="?" src="Resources/Images/BBG/main/iconq.gif"></a>
             <a class="detailCell detailListActions" title="" href="javascript:void(0);"><img width="16" height="16" class="marginRight10" alt="Edit" src="Resources/Images/BBG/eqs/edit.gif"></a>
             </div><!-- /tableRow -->
                            </li>
              <li class="table">
             <div class="tableRow">
              <span class="detailCell detailLabel">Your Occupation:</span>
              <p class="detailResult">Marketing Manager</p>
             <a class="detailCell detailListActions" title="" href="javascript:void(0);"><img width="16" height="16" alt="?" src="Resources/Images/BBG/main/iconq.gif"></a>
             <a class="detailCell detailListActions" title="" href="javascript:void(0);"><img width="16" height="16" class="marginRight10" alt="Edit" src="Resources/Images/BBG/eqs/edit.gif"></a>
             </div><!-- /tableRow -->
                            </li>
              <li class="table shadedList ">
             <div class="tableRow">
              <span class="detailCell detailLabel">Business Type:</span>
              <p class="detailResult">Insurance Broker</p>
             <a class="detailCell detailListActions" title="" href="javascript:void(0);"><img width="16" height="16" alt="?" src="Resources/Images/BBG/main/iconq.gif"></a>
             <a class="detailCell detailListActions" title="" href="javascript:void(0);"><img width="16" height="16" class="marginRight10" alt="Edit" src="Resources/Images/BBG/eqs/edit.gif"></a>
             </div><!-- /tableRow -->
                            </li>
              <li class="table lastLi">
             <div class="tableRow">
              <span class="detailCell detailLabel">Joint Policy Holder:</span>
              <p class="detailResult">Mrs Jane Smith</p>
             <a class="detailCell detailListActions" title="" href="javascript:void(0);"><img width="16" height="16" alt="?" src="Resources/Images/BBG/main/iconq.gif"></a>
             <a class="detailCell detailListActions" title="" href="javascript:void(0);"><img width="16" height="16" class="marginRight10" alt="Edit" src="Resources/Images/BBG/eqs/edit.gif"></a>
             </div><!-- /tableRow -->
                            </li>

           </ul><!-- /revealDetails -->
                <div class="relative">
                <a class="collapseLink floatRight" title="" href="javascript:void(0);"><span class="dottedBot">Hide information</span><img width="16" height="16" class="detailListActions" alt="?" src="Resources/Images/BBG/main/minus.gif"></a>               
            </div>
         </div><!-- /revealBoxContents -->
       </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-05-22T17:29:25+00:00Added an answer on May 22, 2026 at 5:29 pm

    You wrap this with the jQuery $ operator:

    $(document).ready(function(){   
        //On Click
        $('.collapseLink').click(function(){
            $(this).parent().next(".revealBoxContents").stop(true, true).slideToggle('slow');
        });
    });
    

    As one commenter mentioned, this will only work if it is within the link. .closest() may help you in place of find() if it is outside.

    If you post your HTML we might be able to help more.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Tried this: $('.link').click(function(e) { $.getScript('http://www.google.com/uds/api?file=uds.js&amp;v=1.0', function() { $('body').append('<p>GOOGLE API (UDS) is loaded</p>'); }); return
I have a link where I need to be click it automatically using jquery
I have a link on webpage. When I click this link a pop is
I have some jquery code that displays and hides a div when a link
I have below Jquery with me. $(.load-fragment).each(function() { var $objThis = $(this); var fname
When a user click a link, it would redirect them to a page, something
I got this flash application where you can click a link while watching a
i have created Array of Linkbutton and when user click on link button it
I'm showing a hidden box with jQuery on link-click. Now the box disappears when
I have some textboxes on a page and I want to click a link

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.