mozilla
Your Search Results

    ChildNode.remove()

    The ChildNode.remove() method removes the object from the tree it belongs to.
     

    Syntax

    elementNodeReference.remove(); 
    

    Example

    <div id="div-01">Here is div-01</div>
    <div id="div-02">Here is div-02</div>
    <div id="div-03">Here is div-03</div>
    
    var el = document.getElementById('div-01');
    el.nextElementSibling.remove(); // Removes the div with the 'div-02' id
    

    Specifications

    Specification Status Comment
    DOM
    The definition of 'ChildNode.remove' in that specification.
    Living Standard Initial definition.

    Browser compatibility

    Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
    Basic support (on Element) 23.0 23.0 (23.0) Not supported 10.0 7.0
    Support on CharacterData and DocumentType 29.0 23.0 (23.0) Not supported 16.0 7.0
    Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
    Basic support (on Element) (Yes) 23.0 (23.0) Not supported 10.0 Not supported
    Support on CharacterData and DocumentType (Yes) 23.0 (23.0) Not supported 16.0 Not supported

    See also

    Document Tags and Contributors

    Contributors to this page: tregagnon, elisee, fscholz, ziyunfei, jyasskin, teoli, paul.irish
    Last updated by: paul.irish,