title: how to remove a div from the html using ajax
body: <p>I am trying to remove a div (and its children, if its contains) from a webpage. <br>
  Here is the ajax code I am using.</p>
  <pre><code>$.ajax({
      url: window.location,
      method: 'POST',
      dataType: 'text',
      data: {
          delete_id: 1,
          to_delete:deleteID
      }, success: function (response) {
          //Remove this node 
          $('.display_stts').removeChild(response); //It does not work 
      } 
  });
  </code></pre>
  <p>The ajax code returns this, which I would like to remove from the page.</p>
  <pre><code>&lt;div class=&quot;card gedf-card&quot;&gt;
      &lt;div class=&quot;card-body ml-10&quot; style=&quot;padding:5px;&quot;&gt;
          &lt;p class=&quot;card-text&quot; style=&quot;color:blue; font-size:15px; text-align: justify;&quot; name=&quot;cmtSpace&quot; id=&quot;cmtSpace&quot;&gt;
          
              some text some text some text 
              
          &lt;/p&gt;
          
          &lt;div class=&quot;text-right mr-5 replies&quot;&gt;
              &lt;a class=&quot;card-link reply&quot;  href=&quot;javascript:void(0)&quot; data-stID=&quot;124&quot; onclick=&quot;stt_func(this)&quot;&gt;
                  &lt;i class=&quot;fa fa-reply&quot;&gt;&lt;/i&gt;continue
              &lt;/a&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;br&gt;
  </code></pre>
  <p>And this <code>ajax response</code> html code is in a div with the class name <code>class=&quot;display_stts&quot;</code>:</p>
  <pre><code>&lt;div class=&quot;display_stts&quot; id=&quot;display_stts&quot;&gt;
      &lt;!-- displaying here --&gt;
  &lt;/div&gt;
  </code></pre>
  <p>In this class <code>class=&quot;display_stts&quot;</code> I have multiple elements like the one returns by ajax. But I would only like to remove that specific one. <br>
  How could I manage that ?<br>
  Thank you for the taking the time to answer my question.</p>