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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:48:12+00:00 2026-05-23T07:48:12+00:00

HTML: <dl id=feature-list> <dt id=basic class=category-name> <dd id=basic-toggle class=category-recepient> <div class=feature> <div class=feature-content> <input

  • 0

HTML:

<dl id="feature-list">
    <dt id="basic" class="category-name">
    <dd id="basic-toggle" class="category-recepient">
        <div class="feature">
            <div class="feature-content">
            <input id="checkbox1" type="checkbox">
        </div>
        </div>
    </dd>
    <dt id="options" class="category-name">
    <dd id="options-toggle" class="category-recepient">
        <div class="feature">
            <div class="feature-content">
            <input id="checkbox2" type="checkbox">
        </div>
        </div>
    </dd>
</dl> 

JQUERY

$('input').change(function () {
    var value = $(this).closest("dt");
    //do something with value.id
});

$(this).closest("dt") returns the checkbox instead of <dt id="(category)" class="category-name">

I tried $(this).closest(.category-name), $(this).closest("dt").find(.category-name)

  • 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-23T07:48:13+00:00Added an answer on May 23, 2026 at 7:48 am

    Try:

    $(this).parents('dd:first').prev('dt'); // or prev('.category-name')
    

    Demo: http://jsfiddle.net/fJkUq/

    You also need to close your <dt> tags, they should not be containing the <dd>, but adjacent to them.

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

Sidebar

Related Questions

Here is my code: HTML <div class=menu> <ul> <li class=active><a href=index.html>HOME</a></li> <li class=active><a href=#>COMPANY</a></li>
I am new to jQuery. I have a index.html page, <body> <div id=content> </body>
I have list of objects type Node ( items ). And Node class has
I just saw this cool feature of JQuery which is JQuery Portlet http://jqueryui.com/demos/sortable/portlets.html I
When using the app_offline.htm feature of ASP.NET, it only allows html, but no images.
Html.TextBox(ParentPassword, , new { @class = required }) what the gosh darned heck is
I'm trying to list Web features (HTML, CSS, Javascript, APIs) that can be used
I am on ASP.Net MVC 3, and going by the feature list supported in
I have this bit of html that I need to parse though <p class=feature_list>
We determined in a previous question that many features of HTML SELECTs are not

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.