title: jQuery - Remove Each Element
body: <p>Using javascript, I need to remove all matching elements with a single event. </p>
  
  <p>Here is my code </p>
  
  <pre><code>$(document).ready(function(){
        $("#target").blur(function(){
             name = $(this).val();
  
                for (i = 1; i &lt; name; i++) {
                  $("#myspan").clone()
                              .attr({"id":"cloned"})
                              .appendTo("#myspan")
                 }
        });
  
        $("#target").click(function(){
            $("#cloned").remove();
        });
  });
  </code></pre>
  
  <p>As it stands now I have to click the target box multiple times to get all of the clones to remove.
  Im sure its as simple as adding an each but I've worked on this all day and can't seem to find the answer.  </p>