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
0
votes
3 answers

Recover item deleted with parentNode.removeChild

Do you know how I could recover an item deleted with JavaScript in the following way: elem1.parentNode.removeChild(elem1);
Ivan
  • 35
  • 1
  • 8
0
votes
2 answers

Unable to remove form elements while using element.parentNode.removeChild(element)

I have a form that will submit to a Google search appliance, forming a query string "q". In the form I have radio buttons and a hidden element; the radio buttons contain options for sites to select; the hidden element contains multiple sites that…
0
votes
2 answers

Jquery returns index -1 always

This is my index code that I use to return the buttons parent div's index: j('#optionform').index( j(this).parent() ) I'm trying to find out the DIV index of the button clicked, so I can remove the DIV. The HTML layout is like so:
jfreak53
  • 2,239
  • 7
  • 37
  • 53
0
votes
0 answers

Feedback form inside a dialogbox causing error when back button is pressed again android

I am trying to make a feedback form in dialog box. When I press a back button of android it disappears as normal, but when I press it again it gives me an exception: java.lang.IllegalStateException: The specified child already has a parent. You…
moni
  • 13
  • 7
0
votes
4 answers

AS3 if or removeChild not working

For start I have to say that adding - removing child in AS3 is something new to me... I have managed to add anything I want but the problem is that when a new result occur the previous has to disappear and the new will display in the same spot. Well…
0
votes
0 answers

Remove DOM elements from browser completely not just in console.debug

I need to remove or modify elements created by OpenLayers library. If I delete it, I cannot see it in the console.debug anymore if displayed by id, but they are still present in the…
Dávid Natingga
  • 839
  • 3
  • 13
  • 30
0
votes
1 answer

as3 removeChild method in game giving problems

I have seen many questions on removeChild. I've got an invaders type game, where bricks are falling from top, and you have to destroy them with a ball that keeps bouncing around. When I want to remove the brick (referencing it with an array in a for…
Zeeshan Ahmad
  • 345
  • 3
  • 17
0
votes
2 answers

PHP XML: removing Element and all children according to node value?

Hello! i have a problem, Im trying to remove Element (With childs) according to one Child value: Here is the XML Sample: child…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/php" class="post-tag grid--cell" title="show questions tagged 'php'" rel="tag">php</a> <a href="../../questions/tagged/dom" class="post-tag grid--cell" title="show questions tagged 'dom'" rel="tag">dom</a> <a href="../../questions/tagged/removechild" class="post-tag grid--cell" title="show questions tagged 'removechild'" rel="tag">removechild</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Jul 27 '12 at 10:47">asked Jul 27 '12 at 10:47</time> <a href="../../users/1542680/eran-levi" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/1542680.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Eran Levi" /> </a> <div class="s-user-card--info"> <a href="../../users/1542680/eran-levi" class="s-user-card--link">Eran Levi</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">877</li> <li class="s-award-bling s-award-bling__gold" title="2 gold badges">2</li> <li class="s-award-bling s-award-bling__silver" title="12 silver badges">12</li> <li class="s-award-bling s-award-bling__bronze" title="31 bronze badges">31</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-11526888"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/11526888/remove-two-linearlayout-s-inside-a-inflater-layout" class="question-hyperlink">Remove two LinearLayout's inside a inflater layout</a></h3> <div class="excerpt">I have a xml file named socio_form_organization.xml that have two layout's. This xml file is inflated in a layout named content how we can see by the code below socio_form_organization.xml <LinearLayout …</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/android" class="post-tag grid--cell" title="show questions tagged 'android'" rel="tag">android</a> <a href="../../questions/tagged/parent" class="post-tag grid--cell" title="show questions tagged 'parent'" rel="tag">parent</a> <a href="../../questions/tagged/android-linearlayout" class="post-tag grid--cell" title="show questions tagged 'android-linearlayout'" rel="tag">android-linearlayout</a> <a href="../../questions/tagged/removechild" class="post-tag grid--cell" title="show questions tagged 'removechild'" rel="tag">removechild</a> <a href="../../questions/tagged/layout-inflater" class="post-tag grid--cell" title="show questions tagged 'layout-inflater'" rel="tag">layout-inflater</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Jul 17 '12 at 16:31">asked Jul 17 '12 at 16:31</time> <a href="../../users/1532310/ricardo-filipe" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/1532310.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Ricardo Filipe" /> </a> <div class="s-user-card--info"> <a href="../../users/1532310/ricardo-filipe" class="s-user-card--link">Ricardo Filipe</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">435</li> <li class="s-award-bling s-award-bling__gold" title="4 gold badges">4</li> <li class="s-award-bling s-award-bling__silver" title="8 silver badges">8</li> <li class="s-award-bling s-award-bling__bronze" title="24 bronze badges">24</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-11472805"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status "> <strong>2</strong> answers </div> </div> </div> <div class="summary"> <h3><a href="../../questions/11472805/gl-stack-overflow-0x503-error-cocos2d" class="question-hyperlink">GL_STACK_OVERFLOW (0x503) error Cocos2d</a></h3> <div class="excerpt">So I have it set up so when the characters health is < 100 (for testing purposes) it stop the scene and goes to the game over scene. if (playerDataManager.playerHealth < 100) { [[CCDirector sharedDirector] replaceScene:[CCTransitionFade…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/memory-management" class="post-tag grid--cell" title="show questions tagged 'memory-management'" rel="tag">memory-management</a> <a href="../../questions/tagged/opengl-es" class="post-tag grid--cell" title="show questions tagged 'opengl-es'" rel="tag">opengl-es</a> <a href="../../questions/tagged/cocos2d-iphone" class="post-tag grid--cell" title="show questions tagged 'cocos2d-iphone'" rel="tag">cocos2d-iphone</a> <a href="../../questions/tagged/removechild" class="post-tag grid--cell" title="show questions tagged 'removechild'" rel="tag">removechild</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Jul 13 '12 at 14:45">asked Jul 13 '12 at 14:45</time> <a href="../../users/1494432/stenger96" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/1494432.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="stenger96" /> </a> <div class="s-user-card--info"> <a href="../../users/1494432/stenger96" class="s-user-card--link">stenger96</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">224</li> <li class="s-award-bling s-award-bling__silver" title="3 silver badges">3</li> <li class="s-award-bling s-award-bling__bronze" title="17 bronze badges">17</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-11249677"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status "> <strong>3</strong> answers </div> </div> </div> <div class="summary"> <h3><a href="../../questions/11249677/removing-only-the-first-child-element-and-keeping-the-second-with-jquery" class="question-hyperlink">Removing only the first child element and keeping the second with jQuery</a></h3> <div class="excerpt">Looked around and couldn't find an answer to this, but apologies if it's been asked before. I'm looking to replace one DIV with another of the same kind, animating the new one in, then removing the first DIV, allowing the new DIV to take the removed…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/jquery" class="post-tag grid--cell" title="show questions tagged 'jquery'" rel="tag">jquery</a> <a href="../../questions/tagged/dom" class="post-tag grid--cell" title="show questions tagged 'dom'" rel="tag">dom</a> <a href="../../questions/tagged/recursion" class="post-tag grid--cell" title="show questions tagged 'recursion'" rel="tag">recursion</a> <a href="../../questions/tagged/selector" class="post-tag grid--cell" title="show questions tagged 'selector'" rel="tag">selector</a> <a href="../../questions/tagged/removechild" class="post-tag grid--cell" title="show questions tagged 'removechild'" rel="tag">removechild</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Jun 28 '12 at 17:12">asked Jun 28 '12 at 17:12</time> <a href="../../users/1489258/user1489258" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/1489258.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="user1489258" /> </a> <div class="s-user-card--info"> <a href="../../users/1489258/user1489258" class="s-user-card--link">user1489258</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">1</li> <li class="s-award-bling s-award-bling__silver" title="1 silver badges">1</li> <li class="s-award-bling s-award-bling__bronze" title="4 bronze badges">4</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-11216136"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>2</strong> answers </div> </div> </div> <div class="summary"> <h3><a href="../../questions/11216136/removechild-error-in-javascript" class="question-hyperlink">RemoveChild() error in javascript</a></h3> <div class="excerpt">I'm using a function in a php file to create some "li" and some "span" elements like so: while($row_quotes=mysql_fetch_array($result_quotes) and $x<10){ $x++; echo "<li class='citazione'>".$row_quotes['citazione']."</li><span…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/javascript" class="post-tag grid--cell" title="show questions tagged 'javascript'" rel="tag">javascript</a> <a href="../../questions/tagged/removechild" class="post-tag grid--cell" title="show questions tagged 'removechild'" rel="tag">removechild</a> <a href="../../questions/tagged/dom" class="post-tag grid--cell" title="show questions tagged 'dom'" rel="tag">dom</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Jun 26 '12 at 21:24">asked Jun 26 '12 at 21:24</time> <a href="../../users/1218305/bigcola" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/1218305.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="BigCola" /> </a> <div class="s-user-card--info"> <a href="../../users/1218305/bigcola" class="s-user-card--link">BigCola</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">312</li> <li class="s-award-bling s-award-bling__gold" title="1 gold badge">1</li> <li class="s-award-bling s-award-bling__silver" title="4 silver badge">4</li> <li class="s-award-bling s-award-bling__bronze" title="16 bronze badge">16</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-11145878"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/11145878/flash-cs6-actionscript-3-error-2025" class="question-hyperlink">Flash CS6 ActionScript 3 Error #2025</a></h3> <div class="excerpt">I'm working on a webpage for a class and am trying to work the navigation using ActionScript 3. My understanding of how it should work is that when you click the links at the top, it removes whatever is currently displayed, using removeChild, and…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/actionscript-3" class="post-tag grid--cell" title="show questions tagged 'actionscript-3'" rel="tag">actionscript-3</a> <a href="../../questions/tagged/flash" class="post-tag grid--cell" title="show questions tagged 'flash'" rel="tag">flash</a> <a href="../../questions/tagged/removechild" class="post-tag grid--cell" title="show questions tagged 'removechild'" rel="tag">removechild</a> <a href="../../questions/tagged/addchild" class="post-tag grid--cell" title="show questions tagged 'addchild'" rel="tag">addchild</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Jun 21 '12 at 20:03">asked Jun 21 '12 at 20:03</time> <a href="../../users/1403892/steve-w" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/1403892.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Steve W" /> </a> <div class="s-user-card--info"> <a href="../../users/1403892/steve-w" class="s-user-card--link">Steve W</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">5</li> <li class="s-award-bling s-award-bling__silver" title="1 silver badges">1</li> <li class="s-award-bling s-award-bling__bronze" title="4 bronze badges">4</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-11086169"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/11086169/as3-error-1009-removechild-just-wont-work" class="question-hyperlink">AS3 Error #1009 (removeChild just wont work??)</a></h3> <div class="excerpt">This is a little snippet from a little flash game I'm working on: This bit from my GamePlayScreen class: public function handleKeyboard(e:KeyboardEvent):void { if(e.type == KeyboardEvent.KEY_DOWN && e.keyCode == Keyboard.ENTER) { …</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/flash" class="post-tag grid--cell" title="show questions tagged 'flash'" rel="tag">flash</a> <a href="../../questions/tagged/actionscript" class="post-tag grid--cell" title="show questions tagged 'actionscript'" rel="tag">actionscript</a> <a href="../../questions/tagged/removechild" class="post-tag grid--cell" title="show questions tagged 'removechild'" rel="tag">removechild</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Jun 18 '12 at 15:36">asked Jun 18 '12 at 15:36</time> <a href="../../users/1290498/xirb22" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/1290498.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="xirb22" /> </a> <div class="s-user-card--info"> <a href="../../users/1290498/xirb22" class="s-user-card--link">xirb22</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">13</li> <li class="s-award-bling s-award-bling__bronze" title="4 bronze badges">4</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-10644746"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>2</strong> answers </div> </div> </div> <div class="summary"> <h3><a href="../../questions/10644746/as3-removing-dynamically-created-child-movieclips" class="question-hyperlink">AS3 removing dynamically created child movieclips</a></h3> <div class="excerpt">I'm fairly new to AS3. Anyways, I'm try to remove a dynamically created child movieclip when clicked on. When a dirt block is clicked on, which is a child movieclip of 'world' I want to remove it. I've tried various ways of removing it using…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/actionscript-3" class="post-tag grid--cell" title="show questions tagged 'actionscript-3'" rel="tag">actionscript-3</a> <a href="../../questions/tagged/actionscript" class="post-tag grid--cell" title="show questions tagged 'actionscript'" rel="tag">actionscript</a> <a href="../../questions/tagged/movieclip" class="post-tag grid--cell" title="show questions tagged 'movieclip'" rel="tag">movieclip</a> <a href="../../questions/tagged/removechild" class="post-tag grid--cell" title="show questions tagged 'removechild'" rel="tag">removechild</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked May 17 '12 at 23:18">asked May 17 '12 at 23:18</time> <a href="../../users/1402164/brody" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/1402164.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Brody" /> </a> <div class="s-user-card--info"> <a href="../../users/1402164/brody" class="s-user-card--link">Brody</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">3</li> <li class="s-award-bling s-award-bling__silver" title="1 silver badges">1</li> <li class="s-award-bling s-award-bling__bronze" title="2 bronze badges">2</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="s-pagination pager fr"> <a class="s-pagination--item" href="../../questions/tagged/removechild_page=41" rel="prev" title="Go to page 41">Prev </a> <a class="s-pagination--item" href="../../questions/tagged/removechild_page=1" rel="" title="Go to page 1">1</a> <a class="s-pagination--item" href="../../questions/tagged/removechild_page=2" rel="" title="Go to page 2">2</a> <a class="s-pagination--item" href="../../questions/tagged/removechild_page=3" rel="" title="Go to page 3">3</a> <div class="s-pagination--item s-pagination--item__clear">…</div> <a class="s-pagination--item" href="../../questions/tagged/removechild_page=44" rel="" title="Go to page 44">44</a> <a class="s-pagination--item" href="../../questions/tagged/removechild_page=45" rel="" title="Go to page 45">45</a> <a class="s-pagination--item" href="../../questions/tagged/removechild_page=43" rel="next" title="Go to page 43"> Next</a> </div> </div> </div> </div> </div> <script src="../../static/js/stack-icons.js"></script> <script src="../../static/js/fromnow.js"></script> </body> </html>