Jump to content

What ways are there to "delete" elements


etsted

Recommended Posts

you have to select parent to remove target child element for crappy IE, otherwise you could just use remove()

var parentElement = document.getElementById("nav").parentNode; var childToRemove = document.getElementById("nav"); parentElement.removeChild(childToRemove);
Link to comment
Share on other sites

Oh, yes. It is just a working draft and has warnings.

W3C says:

 

Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

MDN says:

 

This is an experimental technologyBecause this technology's specification has not stabilized, check the compatibility table for the proper prefixes to use in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the spec changes.

Link to comment
Share on other sites

It should have introduced a long time ago, seems stupid method to use the element you wish to remove to refer target its parent, after which you target the element itself AGAIN by its parent.

 

Windows Vista programmers great idea i presume.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...