Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #20368

Re: How to clear/remove all the objects in a DIV?

Message-ID <9875396.0bNLEoWOxd@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Organization PointedEars Software (PES)
Date 2013-06-20 18:15 +0200
Subject Re: How to clear/remove all the objects in a DIV?
Newsgroups comp.lang.javascript
References (1 earlier) <9e65bc40-ab97-40aa-91ca-5790829262b3@googlegroups.com> <kptcno$vnu$1@dont-email.me> <3aa0c769-a0d9-4af6-bd01-af62a3c8c47e@googlegroups.com> <18a09a93-fbbf-4d61-a59b-310a06d4d03d@googlegroups.com> <kpv70g$c33$3@dont-email.me>

Show all headers | View raw


Denis McMahon wrote:

> On Wed, 19 Jun 2013 17:39:37 -0700, justaguy wrote:
>> Is there something like removeBefore(nodeName or ID) or deleteBefore
>> (nodeName or ID) or removeAfter or deleteAfter?
> 
> Is it possible that when you delete the immediate children, their
> descendants are still present?

No.  Deleting a node deletes all of its descendants.  However, care must be 
taken regarding the event listeners on descendents as some implementations 
do not clean up properly.
 
> Your div is the root of a tree. What you need to do is trim the tree back
> to the root starting at the most distant branch.

No, you do not.  You just use the “previousSibling” property repeatedly.
 
> […]
> Not tested, obviously.

Like your other junk postings.

-- 
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How to clear/remove all the objects in a DIV? justaguy <lichunshen84@gmail.com> - 2013-06-19 11:14 -0700
  Re: How to clear/remove all the objects in a DIV? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-19 20:36 +0200
    Re: How to clear/remove all the objects in a DIV? Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> - 2013-06-20 19:52 +0100
      Perfect Parlance (was: How to clear/remove all the objects in a DIV?) Christoph Michael Becker <cmbecker69@arcor.de> - 2013-06-21 01:25 +0200
        Re: Perfect Parlance (was: How to clear/remove all the objects in a DIV?) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-06-21 09:41 +0200
          Re: Perfect Parlance Christoph Michael Becker <cmbecker69@arcor.de> - 2013-06-28 23:56 +0200
            Re: Perfect Parlance "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-06-29 00:19 +0200
            Re: Perfect Parlance "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2013-06-29 01:20 +0300
        Re: Perfect Parlance (was: How to clear/remove all the objects in a DIV?) Gene Wirchenko <genew@telus.net> - 2013-06-21 12:52 -0700
          Re: Perfect Parlance (was: How to clear/remove all the objects in a DIV?) John Harris <niam@jghnorth.org.uk.invalid> - 2013-06-24 21:03 +0100
            Re: Perfect Parlance (was: How to clear/remove all the objects in a DIV?) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-06-25 10:50 +0200
  Re: How to clear/remove all the objects in a DIV? justaguy <lichunshen84@gmail.com> - 2013-06-19 13:57 -0700
    Re: How to clear/remove all the objects in a DIV? JJ <duh@nah.meh> - 2013-06-20 05:20 +0700
    Re: How to clear/remove all the objects in a DIV? Gregor Kofler <usenet@gregorkofler.com> - 2013-06-20 00:57 +0200
      Re: How to clear/remove all the objects in a DIV? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-20 01:16 +0200
      Re: How to clear/remove all the objects in a DIV? justaguy <lichunshen84@gmail.com> - 2013-06-19 17:21 -0700
        Re: How to clear/remove all the objects in a DIV? justaguy <lichunshen84@gmail.com> - 2013-06-19 17:39 -0700
          Re: How to clear/remove all the objects in a DIV? Denis McMahon <denismfmcmahon@gmail.com> - 2013-06-20 15:27 +0000
            Re: How to clear/remove all the objects in a DIV? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-20 18:15 +0200
              Re: How to clear/remove all the objects in a DIV? Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2013-06-20 21:01 -0300
  Re: How to clear/remove all the objects in a DIV? justaguy <lichunshen84@gmail.com> - 2013-06-20 07:05 -0700

csiph-web