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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:50:38+00:00 2026-05-20T05:50:38+00:00

Just a quick questions. Im new to this site but this link Show/Hide multiple

  • 0

Just a quick questions. Im new to this site but this link Show/Hide multiple DIVs with Select using jQuery

I just wanted to know how to change the code so its not in a drop down select but an actual link.

If anyone could help me that would be badass!!

I have looked everywhere and this is closest to what i could find.

Thanks everyone. Woot!

  • 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-20T05:50:39+00:00Added an answer on May 20, 2026 at 5:50 am

    I modified the accepted answer from this question how to show/hide divs by select.(jquery) the question the OP linked just so he could see the similarities between doing the two. As it was pointed out this naming convention is not good at all.

    Markup

    <a id="1" href="#">Link one</a>
    <a id="2" href="#">Link two</a>
    <a id="3" href="#">Link three</a>
    
    
    <div id="div1">content here 1</div>
    <div id="div2">content here 2</div>
    <div id="div3">content here 3</div>    
    

    JS

    $(function(){
        $('#div1, #div2, #div3').hide();
    
        $('a').click(function() {
           $('#div1, #div2, #div3').hide();
           $('#div' + $(this).attr('id')).show();
        });
    }
    

    Demo
    http://jsfiddle.net/kJGcE/

    And here is a better way

    Markup

    <a class="divHide" href="#">Link one</a>
    <a class="divHide" href="#">Link two</a>
    <a class="divHide" href="#">Link three</a>
    
    
    <div class="divShow">content here 1</div>
    <div class="divShow">content here 2</div>
    <div class="divShow">content here 3</div>
    

    JS

    $('a.divHide').click(function() {
       $('.divShow').hide();
       $('.divShow').eq($(this).index()).show();
    });
    

    Demo
    http://jsfiddle.net/kJGcE/2/

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

Sidebar

Related Questions

Just a quick question. I'm using something like this FileStream fs = new FileStream(fileName,
Just a quick questions.. I have made an outlook add-in for 2007 version and
just a quick question. I'm having a problem with divs with onclick javascript within
Just a quick question about how you would go about implementing this. I want
Just a quick question on drawing quads. I'm currently using: GraphicsDevice.DrawPrimitives(PrimitiveType primitiveType, int startVertex,
A quick question about saving data in symfony 2. I have this method (just
This is just a quick Question. I am writing a feature here that creates
Hey just a quick question for anyone who has done this. I want to
hey just a couple quick noob questions about writing my first ios app. Ive
I'm new to iOS development, just had a quick question. I'm creating an app

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.