www.webdeveloper.com
Results 1 to 4 of 4

Thread: removeChild Node

Threaded View

  1. #1
    Join Date
    Aug 2009
    Posts
    38

    removeChild Node

    I created 2 div-element dynamically with javaScript. How do I remove both div-elements with a button inside the second one?

    This onClick event removes only the second div:

    var div1= '<div id="a1">
    </div>';

    var div2= '<div id="a2">
    <button onclick="this.parentNode.parentNode.removeChil(this.parentNode);>
    </div>';

    Extra:
    Is there a way to remove all child nodes?
    Last edited by massalexx; 10-07-2009 at 02:05 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles