Web Analytics Made Easy -
StatCounter remove nodes. - CodingForum

Announcement

Collapse
No announcement yet.

remove nodes.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • remove nodes.

    currently I am doing as following to remove a node.


    A_NODE.parentNode.removeChild(A_NODE);

    this to me sound a bit like a detour. I tried.

    A_NODE.remove();

    but that only seemed to remove the node in question and not it children. so my question is are there any way shorter than the 1st example to remove a node and all its children?

  • #2
    No. Don't you think that's short enough?
    liorean <[[email protected]]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

    Comment


    • #3
      well sure but it seems odd to me that I have to go to the parent and find the node in it when I already had the node I wanted to remove

      Comment


      • #4
        But you want to remove the node and its children not only the node itself.
        Glenn
        vBulletin Mods That Rock!

        Comment

        Working...
        X