How to remove elements from DOM in jQuery

  1727 views   2 years ago jQuery

Use the jQuery remove() method

You can simply use the jQuery remove() method to remove the elements from DOM. This method will remove the matched elements as well as everything inside of it.

The following example will show you how to remove a paragraph from DOM completely.

<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>jQuery Remove Elements from DOM</title>
<script src=""></script>
    <button>Remove paragraph</button>
    <h1>This is a heading</h1>
    <p>This is a paragraph.</p>


Author : Harsukh Makwana
Harsukh Makwana

Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]