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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:47:05+00:00 2026-05-16T21:47:05+00:00

How to select a class which is the parent from a parent? js <div

  • 0

How to select a class which is the parent from a parent?

js

<div onclick="$('.al_head.tt_this).closest('.aledmsg').remove();" style="cursor:pointer;"> TEST </div> 

html

<div id="albox">

    <div class="al_head" style="margin-bottom: 5px;" id="alss"> <img  src="bt.png" alt="se">
    <div style="float: left; width: 282px;" class="aledmsg"><strong>Feexts</strong>
      <hr>
      <div class="ams" id="xc98f">blub</div>
      <div class="ams tt_this" id="xb697">blib <-</div>
      <div class="ams" id="x56b1">blab</div>
      <div class="ams tt_this" id="xb214">blnb <-</div>
       <div class="ams tt_this" id="xb997">blmb <-</div>      
    </div>
  </div>
           <br />   <br />
    <div class="al_head_2" style="margin-bottom: 5px;" id="alss"> <img  src="bt.png" alt="se">
    <div style="float: left; width: 282px;" class="aledmsg_2"><strong>Feexts 2</strong>
      <hr>
      <div class="ams" id="xc98f">blub</div>
      <div class="ams tt_this" id="xb697">blib <-</div>
      <div class="ams" id="x56b1">blab</div>
      <div class="ams tt_this" id="xb214">blnb <-</div>
       <div class="ams tt_this" id="xb997">blmb <-</div>      
    </div>
  </div>

</div>

http://jsfiddle.net/RAN9C/9/

  • 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-16T21:47:06+00:00Added an answer on May 16, 2026 at 9:47 pm

    I think this is what you’re after:

    $('#albox .tt_this').closest('.aledmsg').remove();
    

    You can give it a try here, the quotes don’t match on the initial selector and the .tt_this class is on a child, not directly on the #albox <div>.

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

Sidebar

Related Questions

I have a DAO class which I'm using to try select/update/insert with hibernate and
I need to select node which has a specific value: <td class='formlabel'>Name:</td> So I
I can select the first item in the div using $('.class:first') Now since I
<div id = 'eventcontainer' > <span id = 'class'> <?php //Getting posts from DB
I have a class which has a collection public class Parent { ... ISet<Child>
I wounder if there is some possible to know from which parent Iam coming
How can I set a select class and other attributes eg:events through the SelectList
I have a simple question about the expression in jquery to select a class
I need to select elements of a certain class except children of $(this). The
I've written a class that contains Select- and Update-Methods for an ObjectDataSource. The UpdateMethod

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.