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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:31:47+00:00 2026-05-19T04:31:47+00:00

Basically I am trying to show hide divs and links, but having some trouble.

  • 0

Basically I am trying to show hide divs and links, but having some trouble. The functionality required is as follows:

  • On page load, DIV ID ‘additional-languages’ is hidden
  • User can click the ‘Selected Additional Languages’ link which will show the ‘additional-languages’ DIV
  • At the point of clicking this link, the link will get hidden
  • User can then choose to hide the ‘additional-languages’ DIV by clicking on the ‘hide’ link
  • At the point of clicking this link, the ‘Selected Additional Languages’ link will re-appear

Here is what I have done so far:

Markup:

<div class="row">
    <label for="native_language">Select</label>
    <select name="native_language" id="native_language">
      <option value="">Any</option>
      <option value="1">English</option>
    </select>

    <a class="show-additional-link" href="#">Select Additional Languages</a>
</div>

<div id="additional-languages" style="display: none;">
    <a class="hide-additional-link" href="#">[hide]</a>

    <div class="row">
        <!-- additional language checkboxes -->
    </div>
</div>

JS:

$('.show-additional-link').click(function(){
    $(this).parent().next().slideDown();
    $(this).hide();
    return false;
});

The first part is working for me, but I’m struggling on getting the second part to work, i.e. the functionality for the ‘hide-additional-link’. I have tried this:

$('.hide-additional-link').click(function(){
    $(this).parent().slideUp();
    $(this).parent().prev('.show-additional-link').show();
    return false;
});

The DIV gets hidden but the ‘show-additional-link’ does not get shown.

  • 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-19T04:31:48+00:00Added an answer on May 19, 2026 at 4:31 am

    Change this:

    $(this).prev('.show-additional-link').show();
    

    to this:

    $(this).parent().prev("div.row").find('.show-additional-link').show();
    

    .prev will target, strictly, the immediately previous sibling. Your .show-additional-link button is a child of the previous div, so basically you need to go up one level, get the previous div, and find the .show-additional-link descendant.

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

Sidebar

Related Questions

I am basically trying to hide a DIV on the homepage but have it
Basically on .show() I've been trying to have all of the inputs convert to
Im trying to cut down some code, basically the following click event is used
I'm trying to implement a custom button on a jqGrid with hide and show
I am trying to use the UINavigationController class in Objective-C, but I am having
I have a button that i basically want to either show or hide it
I'm trying to read a cookie, but don't have a clue how, basically. The
I'm trying my best to make this make sense, but basically I have a
So basically I am trying to have div.show fade in on hover and then
I'm trying to create a dynamic portfolio gallery where you can hide show items

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.