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
4 answers

JavaScript removeChild not working

I am using this JavaScript code to remove a couple elements from the page, but it's not working. When I inspect the code with Opera Dragonfly it says something like: Uncaught exception: Error: WRONG_ARGUMENTS_ERR and points to the file and function…
Leandro Zhuzhi
  • 304
  • 1
  • 7
  • 17
0
votes
1 answer

How to remove a child from inside it if it doesn't know it is child

I got quite a nice title:) My main class is @interface StartLayer : CCScene I used HelpView* hp = [[HelpView alloc]initWithFrame:CGRectMake(0, 0, 320, 520)]; CCUIViewWrapper* wrapper = [CCUIViewWrapper wrapperForUIView:hp]; [self…
Alexander
  • 233
  • 1
  • 4
  • 14
0
votes
1 answer

jquery replacing attr

I have list of divs that are produced dynamically, which basically users clicks on one of the them ex: the div dat has data-square=0-1 and then clicks on the div data-square=0.8, the class attr and data-square values are being send to server and…
0
votes
3 answers

Actionscript 3.0 - removeChild doesn't work

I'm trying to write the base code for a graphing document that shows a value on the graph each time an int is pushed into an array. Here is the code- import flash.display.Shape; import flash.display.MovieClip; import flash.display.Sprite; var…
James McGrath
  • 187
  • 1
  • 4
  • 15
0
votes
1 answer

grails .removeFrom when object exists elsewhere in class

So essentially I have two classes: Class User { String Name } Class Project { User requestedBy static hasMany = [ assignedTo: User ] } Now, I can set the requestedBy to say, User 1. I can also do Project.addToAssignedTo(User…
James Kleeh
  • 12,094
  • 5
  • 34
  • 61
-1
votes
1 answer

Removing an element form XML file in PHP

i tried to find it out with previous answers but i cannot do it propperly, i followed Stefan's answer Remove a child with a specific attribute, in SimpleXML for PHP and my code is xml:
andrewpo
  • 361
  • 1
  • 6
  • 14
-1
votes
1 answer

Powershell script to remove tempory files and registry keys

I've created a small PowerShell script to remove a Autodesk application. However, PowerShell doesn't seam to like system variables like %username%. Whats the best way of achieving this in Powershell? # Remove all Autodesk products from a Windows…
resolver101
  • 2,155
  • 11
  • 41
  • 53
-1
votes
1 answer

Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. at HTMLLIElement.

let inputValue = document.querySelector('.input') let button = document.querySelector('.button') let items = document.querySelector('#ul') button.addEventListener('click', function (){ let li = document.createElement('li') let deleteBtn =…
-1
votes
1 answer

Creating and Deleting Created Element Using Javascript

Suppose... I have a Create Button and this Create Button creates Block level Element every time Create Button is clicked ... I mean If you click Create Button 100 times, it will create block Element 100 times. Into that Block element, I have a…
Mihir
  • 1
  • 1
-1
votes
2 answers

Queshtion about removing an item for a map

Im having trouble configuring a remove function for my shopping-list project, the purpose of the project is to make a shopping list with a checkbox, a quantity and an item name, but there's another feature that i can't figure out how to add it, i…
-1
votes
1 answer

I have a problem with the method removeChild

I'm new here on Stackoverflow, started programming in January, small own applications could already be implemented and now I have a problem with JavaScript with the removeChild method, because I don't know how to use this method with other methods…
Sven
  • 1
-1
votes
1 answer

Trying to remove a paragraph in JavaScript

I am doing an assignment where I'm meant to remove a paragraph from the page when a button is clicked. I keep returning an error "Uncaught TypeError: Node.removeChild: Argument 1 is not an object." and it references line 37 in my code. Line…
-1
votes
1 answer

I want to use vanilla JS to remove the parent element of the button I'm pressing on click

I created a meme generator that accepts text and images and puts them all together. The generator creates a unique ID for each 'meme' and also adds buttons that show up on hover to "delete" the meme. I used vanilla JS to create this and therefore…
davdev
  • 9
  • 2
-1
votes
2 answers

What is the function of the the double parentNode in Javascript?

i wanna ask what does this function do and what does the "element.parentNode.parentNode" mean? function removeToDo(element){ element.parentNode.parentNode.removeChild(element.parentNode) }
-1
votes
1 answer

Delete all button in to do app

I try to add delete all to my to do app. I have something like this: function removeAll(){ var ol = document.getElementsByTagName('ol'); if(ol.lenght > 0){ ol.remove(); } …
Damian
  • 31
  • 1
  • 7