Assuming that this
is .d
, you can write
$(this).closest('.a');
The closest
method returns the innermost parent of your element that matches the selector.
More Related Contents:
- jQuery. Find all attribute values within/under elements `script or noscript or iframe` that have attribute keys as `src or href` [closed]
- jQuery document.createElement equivalent?
- How can I select an element by name with jQuery?
- What is the most efficient way to create HTML elements using jQuery?
- How do I create a link using javascript?
- How to show Page Loading div until the page has finished loading?
- Finding line-wraps
- How to get the element clicked (for the whole document)?
- Why are duplicate ID values not allowed in HTML?
- Is there a DOM event that fires when an HTML select element is closed?
- jQuery: how to change tag name?
- Is there any “on DOM change” event? [duplicate]
- Get the DOM path of the clicked
- How to move table row in jQuery?
- Jquery Event Not Triggering for DOM Elements Created after page load [duplicate]
- Why do multiple `.appendTo` calls on a newly created jQuery element only append it once?
- How to add DOM element script to head section?
- Uncaught TypeError: Cannot read property ‘top’ of undefined
- JQuery html() vs. innerHTML
- How can I get access to a Highcharts chart through a DOM-Container?
- Open new window without focus on it [duplicate]
- How can I remove wrapper (parent element) without removing the child?
- User Activity Tracking using javascript library [closed]
- window.getSelection return html [duplicate]
- How to properly unload/destroy a VIDEO element
- How to get on-screen visible element objects in jQuery? [duplicate]
- Test if an element can contain text
- Why I cant use jQuery functionality
- Browser detection versus feature detection
- Find and replace nth occurrence of [bracketed] expression in string