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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:38:14+00:00 2026-06-17T14:38:14+00:00

I recently found an answer to one of my questions here on stackoverflow which

  • 0

I recently found an answer to one of my questions here on stackoverflow which involved showing and hiding a div based on the value of a dropdown, here is the demo – http://jsfiddle.net/pXdS6/16/

My new question is, what if I wanted to show multiple divs with the same id based on the value

html like this:

<div id="divarea1" class="box">DIV Area 1</div>
<div id="divarea2" class="box">DIV Area 2</div>
<div id="divarea3" class="box">DIV Area 3</div>
<div id="divarea3" class="box">DIV Area 3</div>

If I select “DIV Area 3” from the dropdown I want both divs with #divarea3 to display

  • 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-17T14:38:15+00:00Added an answer on June 17, 2026 at 2:38 pm

    You cannot and should not have multiple DOM elements with the same id. Use classes. Use hundreds of classes (not really) if you have to, to group them.
    Once you have the classes working,

    <div id="divarea1" class="box set1">DIV Area 1</div>
    <div id="divarea2" class="box set1">DIV Area 2</div>
    <div id="divarea3" class="box set2">DIV Area 3</div>
    <div id="divarea4" class="box set2">DIV Area 3</div>
    
    $('.set2').show();
    

    This should do what you wanted to achieve.

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

Sidebar

Related Questions

I recently found that one of my services was taking a large amount of
Like many other people posting questions here, I recently started programming in Python. I'm
The obvious answer is to use Charset.defaultCharset() but we recently found out that this
recently found an article in http://hashtwo.com/blog/integrating-a-file-browser-into-ckeditor-cakephp to integrate a file browser into ckeditor (file
I recently found that dynamically creating object and methods in Ruby is quite a
I recently found javafx 2.1 very useful for my project of making a video
I recently found the mobipick calendar and I really like it due to its
I recently found out about Cytoscape.js and would like to try out the force-directed
I recently found out about the WeakHashMap data structure in Java. However, I don't
I recently found a code to send emails using python. It was only for

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.