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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:18:59+00:00 2026-05-25T00:18:59+00:00

I am trying to delete the child element in the dom from its parent

  • 0

I am trying to delete the child element in the dom from its parent using jquery.

Here is the code snippet.

$('#delete').live('click' , function() {

    var strchild = m.split("/",2)[1];
    var c = group.children(strchild);
    c.remove();

});

strchild contains the id of the child element. group is the parent object. I am getting the right child element in the variable c. But the remove function fails.

Can some help me out here.

Thanks.

  • 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-25T00:19:00+00:00Added an answer on May 25, 2026 at 12:19 am

    If you have

    strchild
    

    as the id of the element you want to remove, you can do

    $("#" + strchild).remove()
    

    assuming it is the only element with that id (it should be, that’s the whole point of id).

    EDIT:

    With multiple ids, you would need to reference the parent specifically. This is very simple, since you say in your question that group is the parent object. This answer assumes it is the object itself, rather than the id, as your code sample implies.

    $("#" + strchild, group).remove()
    

    Adding the second argument here constrains the selector to the specifications of that second argument. So this will search the parent (group) for an element with the id strchild, and then remove that element.

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

Sidebar

Related Questions

I am trying to delete MySQL table rows from a Web page using Perl.
I am trying to delete some child rows using a filtered query without result:
Using mongodb I'm trying to remove a property (_id) from a child collection (ListingFeatures)
I am trying to delete a child record when parent is deleted. There is
I'm trying to remove a child entity from a parent collection navigation property. There
When trying to save an ID from my parent class into a child class,
I´m trying to map a list using NHibernate that is part of a parent-child
I'm trying to delete a specific line by id from a file in C++
I'm trying to delete certain lines from a file. My file is a .txt
I'm trying to delete all rows in a table using Castle ActiveRecord. Normally, I

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.