jQuery Tutorial Tutorials - jQuery .remove() method

jQuery .remove() method

The .remove() method in jQuery is used to remove all matched elements from DOM. This method also remove the jQuery data associated with the remove elements, like event hanlders,attached data.

jQuery .remove() method Syntax

.remove()

jQuery .remove() method Example

Remove all paragraphs from the DOM.
HTML

<div class="container">
    <p>Learn JavaScript</p>
    <p>Learn jQuery</p>
    Lautturi tutorial
</div>

jQuery

$("p").remove();

Result

<div class="container">
    Lautturi tutorial
</div>

Try now

Date:2019-08-25 10:25:14 From:www.Lautturi.com author:Lautturi