top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

How to remove set of matched elements in jQuery?

0 votes
How to remove set of matched elements in jQuery?
posted Jul 18, 2017 by Saheb Pro

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

0 votes

The .remove() method removes all matched elements from the DOM. Use .remove() when you want to remove the element itself, as well as everything inside it (its child elements). In addition to the elements themselves, all bound events and jQuery data associated with the elements are removed.


  <meta charset="utf-8">
  <title>remove demo</title>
  p {
    background: yellow;
    margin: 6px 0;
  <script src=""></script>
  <p>Hello how are you?</p>
  Hello how are you?
  <p>Hello how are you?</p>
  <button>Remove Element</button>
  $( "button" ).click(function() {
    $( "p" ).remove();


enter image description here

After Click on Remove Element Button

enter image description here

answer Jul 18, 2017 by Shyam Chakraborty
Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.