Questions tagged [removechild]

removes and returns a child node from the DOM

Description

Removes and returns a child node from the DOM.

The removed child node still exists in memory, but is no longer part of the DOM. It can still be re-used, via the oldChild object reference.

Syntax

var oldChild = element.removeChild(child);
element.removeChild(child);

where,

child is the child node to be removed from the DOM.

element is the parent node of child.

oldChild holds a reference to the removed child node. oldChild === child.

References

672 questions
5
votes
2 answers

Remove an item in RecyclerView- Android

I am facing a problem, I could not remove an Item in RecyclerView. I am trying to search in Internet, but could not see any solution I am following to this post Android RecyclerView addition & removal of items But I still could not remove the item…
user3157841
  • 79
  • 1
  • 1
  • 6
5
votes
1 answer

vue.js remove element after transition

I'm creating a sort of notification system inside my webpage with vue.js All works fine but i want to remove the element after the transition is completed. I only get this to work with an setTimeout but that is not the ideal method Working…
andre de waard
  • 134
  • 2
  • 6
  • 22
5
votes
3 answers

Delete a child node using RemoveChild()

I would like to delete just this one node, for example: Sample2 from this XML, for example: BaseSamples Sample1
Amy
  • 51
  • 1
  • 1
  • 2
5
votes
2 answers

How to remove Children from an AbsoluteLayout in Xamarin.Forms?

In my app I use a Xamarin.Forms AbsoluteLayout. I have a custom menu bar. When I clicked on a menu button, the main content (a View) of my AbsoluteLayout is supposed to be replaced. So far I can only achieve that by adding a new child and setting…
kaolick
  • 4,817
  • 5
  • 42
  • 53
5
votes
2 answers

Sprite Kit Remove SKNode From Parent When Off Screen

I would like to know how to remove my SKNodes when they are off screen to help my game run more smoothly. How To Do This On Sprite Kit Thanks So Much
user3773099
  • 73
  • 1
  • 3
5
votes
3 answers

Javascript not removing all elements within a div

This piece of javascript code is created to remove all inputs that are within a div function remove_inputs(){ var elements=document.getElementById('thediv').getElementsByTagName('input'); for(var i=0;i
AMD
  • 1,278
  • 4
  • 15
  • 33
5
votes
4 answers

How to remove next element using JavaScript (without using jQuery)

I need something like this. Save Cancel Delete If I click on the Save anchor , I want to remove all three anchor elements as …
aman
  • 97
  • 1
  • 1
  • 8
4
votes
1 answer

Correctly deleting child elements in PHP using DOMDocument and DOMXPath

This was previous another question, but we won't talk about that. I am isolating a number of sections in a third party HTML document. When matching some, I need to remove certain tags from the result. The code I found for this on SO was: $name =…
user137621
4
votes
1 answer

Remove() From Collection Does Not Mark Object As Deleted - EF4

I'm using POCO generated classes - any way that I can tweek the template so that when I remove from a child collection, the item removed is also deleted from the db ? Or maybe in the partial class I can override something, catch an event…
sirrocco
  • 7,975
  • 4
  • 59
  • 81
4
votes
2 answers

A deleting button deletes itself instead of the targeted element

I got a really bothering problem which I can not understand. I have a div which contains 2 paragraphs, and a clickable button to delete the first p element, but the strange thing is that the button deletes it self and the p element continues to…
M.Taki_Eddine
  • 160
  • 2
  • 11
4
votes
3 answers

Add/remove
  • element from the ul javascript
  • I am new in JavaScript and still learning various things. Right now i'm stuck with adding and removing li elements from the list. I did the exercise just fine using jQuery, but now have difficulties with the pure JS version of the same task. The…
    Ani
    • 57
    • 1
    • 1
    • 7
    4
    votes
    4 answers

    Function RemoveChild(XmlNode node) failed in C#

    When I try to remove some of my child element with RemoveChild(). But throw exception. I attached my code below. nodeName = doc.SelectSingleNode("//Equipment//DataCollections//EnabledIDs//MyID[@id='" + attrValue + "']"); // Found the…
    Nano HE
    • 9,109
    • 31
    • 97
    • 137
    4
    votes
    1 answer

    Multiple Child Nodes in EnumerateChildNodesWithName

    I'm removing and adding nodes using enumerateChildNodesWithName. I wondering if there is a way of using the enumerateChildNodesWithName with multiple names. For example, at the moment I am using the below: …
    Jarron
    • 1,049
    • 2
    • 13
    • 29
    4
    votes
    2 answers

    Javascript removeChild function returning TypeError: Value not an object

    I made function in javascript that checks if the div element with an ID of #stage has any child nodes, and if so it has it to delete them when the function is called. When I start the website, Firebug returns me an error, that goes like…
    depecheSoul
    • 896
    • 1
    • 12
    • 29
    4
    votes
    4 answers

    jQuery empty but exclude a certain element

    I try to empty() a div but exclude a specific selector. What I've tried so far: $('.modal').find('.close').nextAll().empty(); $('.modal').find(':not(.close)').empty(); $('.modal').not('.close').empty(); $('.modal:not(.close)').empty(); HTML:
    yckart
    • 32,460
    • 9
    • 122
    • 129
    1
    2
    3
    44 45