/    Sign up×
Community /Pin to ProfileBookmark

need help with children

Hi! I’m new and I have a question so here goes.

I’m working with element creation and text. Basically, I have an ultimate parent element that acts as a pane for a number of text views. To create a text view, I create a bunch of elements and populate them with text nodes. I attach these elements as children to the pane.

My question is, is there a way to remove all the child elements along with their nodes from my pane?

Any clues would be great.

Josh

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@JonaApr 19.2003 — I believe there is a built-in array of all child nodes of a parent node. Unfortunately, I'm not sure what it is... You could use it and a for() loop to remove all children. You could also remove each child individually.
Copy linkTweet thisAlerts:
@khalidali63Apr 19.2003 — This script uses DOM methods to do what you want,it might help

http://68.145.35.86/skills/javascripts/DOMTableManipulation.html

?
×

Success!

Help @retro spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...