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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:22:18+00:00 2026-05-13T12:22:18+00:00

I have a triggered javascript function to hide dds which have the same class

  • 0

I have a triggered javascript function to hide “dd”s which have the same class name. But the problem is, sometimes, only the dt is left alone. For example, the first dt dd block, when I hidden the all 3 dd’s. the dt (today) one is still there. I want to hide the dt too when no dd is associated. How can i do that?

<dl>
    <dt>Today</dt>
    <dd class="Admissions3">14:59 > Admission: Transfer, B3FOL, Metroplex Hospital</dd>
    <dd class="Admissions3">12:00 > IM: Review by Me, Wound healing well. Could need further follow-up...</dd>
    <dd class="Admissions3" style="color: Black">09:42 > LAB: WOUND CULTURE, Staph aureus (Pending)</dd> <dt>Yesterday</dt>

    <dd class="Laboratory3">16:40 > LAB: UMCS, Blood, Enterococcus sp. Light growth of (Pending)</dd>
    <dd class="Surgery3">10:35 > SUR: Right Total Hip Replacement</dd> <dt>Two days ago</dt>

    <dd class="Admissions3">16:25 > ADT: Transfer, ICU, Metroplex Hospital</dd>
    <dd class="Laboratory3">13:15 > LAB: UMCS, Swab, No growth</dd>
    <dd class="Admissions3">13:10 > ADT: Admit EXC HUTCHINSONS MELANOTIC FRECKLE</dd> <dt>Four days ago</dt>

    <dd class="CentralLine3">14:24 > RM: Parking Incident</dd>
    <dd class="CentralLine3">14:05 > RX: Doxycycline 4g Daily</dd>
    <dd class="Admissions3">13:20 > ADT: Podiatry</dd> <dt>9/7/09</dt>

    <dd class="Laboratory3">15:32 > LAB: UMCS, Blood, No growth</dd>
    <dd class="Pharmacy3">10:18 > IM: Isolation Precautions - High</dd> <dt>3/5/09</dt>

    <dd class="Surgery3">11:45 > SUR: Left Total Hip Replacement</dd>
    <dd class="Admissions3">09:20 > ADM: Transfer, B3ROD, Real World Hospital</dd>
    <dd class="Admissions3">09:17 > ADM: Total Hip Replacement, Real World Hospital</dd>
</dl>
  • 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-13T12:22:18+00:00Added an answer on May 13, 2026 at 12:22 pm

    This little segment of code might help.

    var $dl = $('dl'); // hook this up to your DL
    
    $dl.find('dt').each(function() {
      var $dt = $(this), $next = $dt.nextAll(':visible').slice(0,1);
    
      // if the next visible item is also a dt, or there isn't a next visible item
      if ($next.is('dt') || $next.length == 0)
      {
        $dt.hide();
      } else {
        $dt.show();
      }
    });      
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a collapsible div implemented in js, the function of which is show/hide
I have this Javascript: <script language=javascript type=text/javascript> $().ready(function() { $('#ex2').jqm({ajax: 'view.php?id=<?=$objResult[id];?>', trigger: 'a.ex2trigger'}); });
I have an external javascript library which triggers on the change of a textarea,
I have a parentview which dynamically creates a child view and I have triggered
I have a JS function - triggered with onclick -, that is dynamically changing
I have code that is triggered on launch only after the app is upgraded
I have a function that is triggered by the onkeydown event of a textbox.
We have a application which is triggered from browser. This application consumes around 800
I have a LoadingStatus Function that has two options SHOW or HIDE. The Show
I have the following Javascript code which controls an accordion type set of divs.

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.