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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:43:30+00:00 2026-06-10T21:43:30+00:00

I have a modal popup which has different divs for different messages, now i

  • 0

I have a modal popup which has different divs for different messages, now i want to hide each div and show just the one I need to show. instead of writing out each div id and setting it to hidden i wanted to do a loop so i put my divs inside an UL list. But I can’t seem to figure out how to hide just the divs inside that UL list..

$("#panels li").each(function (i) {
        $('div').toggle();
    });

<ul id="panels">
        <li><div id="dvError" class="hiddencol">this is div 1</div></li>
        <li><div id="dvconfirm" class="hiddencol">this is div 2</div></li>
</ul>

for some reason when I do this it hides them but it hides every div on my page 🙁

  • 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-10T21:43:32+00:00Added an answer on June 10, 2026 at 9:43 pm

    You can just do

    $("#panels").find('div').toggle();
    

    or

    $("#panels div").toggle();
    

    or if you want to keep your loop

    $("#panels li").each(function (i) {
        $(this).find('div').toggle();
    });
    

    $('div').toggle(); <– this will toggle every div on your page

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

Sidebar

Related Questions

We have a colorbox modal popup which we don't want to close unless the
I have a modal popup extender which is triggered by gridview onRowCommand. The gridview
I have an ajax modal popup, which is shown on click of a button
I have 3 different types of modal windows to handle different events. They popup
Have a question regarding something which has been bugging me for some time now.I'm
I have a page (page1), which loads a different page (page2) into a modal
I have a jqgrid in a modal popup that has data dependent on some
I have an Popup(not modal window) which shows textbox, when I start typing in
Background: I have a popup which lets me create a company, this popup has
have a menu item which displays a modal div. wish the created div to

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.