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

  • Home
  • SEARCH
  • 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 8309867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:15:19+00:00 2026-06-08T19:15:19+00:00

I am having a challenge. I have 2 divs , one set to display:none;

  • 0

I am having a challenge.
I have 2 divs, one set to display:none; in the css when the page loads
I have two corresponding links. When the user clicks on link1 I would like to show div1 and hide div2. And when the user clicks on link2 I would like to show div2 and hide div1.

I have not been able to get this to work! Any help much appreciated.
S

  • 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-08T19:15:20+00:00Added an answer on June 8, 2026 at 7:15 pm

    Here an example:

    $(function () {
      $(".div1, .div2").hide();
    
      $(".link1, .link2").bind("click", function () {
        $(".div1, .div2").hide();        
    
        if ($(this).attr("class") == "link1")
        {
          $(".div1").show();
        }
        else
        {
          $(".div2").show();
        }
      });
    
    });
    

    And here is the Demo

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

Sidebar

Related Questions

I have a set of custom user controls, of type ChartControl. I want to
I have two tables, one containing a list of different options users can select
I have set myself a simple challenge, which I see in many apps and
Having used storyboards for a while now I have found them extremely useful however,
I'm having quite a challenge creating an appropriate rewrite rule for Apache/2.2.14 on Fedora
I'm having difficultly adding querystring parameters to link_to UrlHelper. I have an Index view,
I have set up this programming exercise. using System; using System.Collections.Generic; using System.Linq; using
I'm having trouble trying to figure out how to achieve this programming challenge in
Here's the challenge: I have a Flash movie which will be embedded in a
I Have a Challenge like this, Dictionary<string,Dictionary<string,int>> dic=new Dictionary<string,Dictionary<string,int>>(); i want them into a

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.