JSFiddle - React, Tailwind, and code Playground

HTML

<input type="button" value="test remove after traversing">
<form action="#">
    <div>text</div>
    <p>bla</p>
</form>

JavaScript

$(function () {

    $( 'input' ).click(function () {
        $( 'form' )
        .find( 'div' )
            .remove()
            .end()
        .remove();
        if ( console && console.log ) {
            console.log($( 'form' ))
        }
    });
});