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
3
votes
1 answer

The supplied DisplayObject must be a child of the caller

I am a newbie, and I have seached and tried for weeks on this, and I cannot get the grip on this. The simple code below gives the "The supplied DisplayObject must be a child of the caller" error. var square = new…
Harald
  • 31
  • 1
  • 1
  • 2
3
votes
1 answer

How to unload jquery ui tabs that are hidden/ not active?

I am using Jquery UI tabs in my asp.net mvc web application. I have total of 6 tabs. Each tab contains a user control. I am dynamically loading the contents into each tab using ajax like this:
Sai Avinash
  • 4,683
  • 17
  • 58
  • 96
3
votes
1 answer

Delete a node lxml python

I have found a lot of examples to remove element node in an XML file. BUt here is an example for which I didnt find any solution either on stackoverflow or google. For example: America 2 3 4…
Sangamesh Hs
  • 1,447
  • 3
  • 24
  • 39
3
votes
4 answers

can't remove dynamically added scripts

I am appending a child element with a reference to at javascript and a stylesheet, but I would like to delete it again when there is no use of it anymore. var head = document.getElementsByTagName('head')[0]; // We create the style …
Corfitz.
  • 1,864
  • 3
  • 31
  • 53
3
votes
2 answers

Remove script from site before being executed

I have a site I'm loading via iframe and it's on the same server. I need to remove a certain script tag before the page inside the iframe is loaded. In order words, intercept and remove the script before it's executed. I tried var x =…
user2028856
  • 3,063
  • 8
  • 44
  • 71
3
votes
5 answers

Remove all child nodes but leave the text content of the node in javascript (no framework)

I'm trying to remove all child elements from a node but leave the actual text content of the node. I.e. go from this:

MY TEXT Link Link