title: remove content using ajax
body: <p>I am new to ajax.</p>
  
  <p>I have <strong>index.html</strong></p>
  
  <pre><code>&lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;script&gt;
  $(document).ready(function(){
    $("button").click(function(){
      $.ajax({url:"n.php",success:function(result){
        $("#div1").append(result);
      }});
    });
  });
  &lt;/script&gt;
  
  &lt;div id="div1" style="margin-left: 25;"&gt;&lt;/div&gt;
  &lt;button&gt;Add Author&lt;/button&gt;
  </code></pre>
  
  <p><strong>demo.php</strong></p>
  
  <pre><code>Name:&lt;input type="text" name="txtname"&gt;
  age:&lt;input type="text" name="txtage"&gt;
  </code></pre>
  
  <p>Above code adds name and age textboxes on index.html page when 'Add Author' button clicks without refreshing page.</p>
  
  <p>Now I want to put another button 'remove author',and want to perform exact opposite action(i.e) remove Name and age textboxes which are added previously.</p>
  
  <p>I don't know how to do this.Is it possible through something like this 
  <code>$("#div1").(result);</code> </p>
  
  <p>Thanx in advance.</p>