How can you remove a dynamically created div with unique id?
<p>I'm only going to post the code that's relevant. If you need my whole code, let me know.</p>

<p>Anyway, I have the following code:</p>

<pre><code> var deck = [];
 var c = 0;
$('#add').click(function(){
     var addToDeck = $('input[name=searchItem]').val();
     addToDeck = addToDeck.toLowerCase();
     deck.push(addToDeck);
   $('#save').append('&lt;div id="cardList' + (c++) + '"&gt;' + database[deck[deck.length-1]].name + '&lt;/div&gt;');
 });
</code></pre>

<p>Which dynamically adds divs with unique id's each time a certain button is pressed (ex: cardList1, cardList2, etc). Now, if the user clicks on some div with a particular id (say cardList2), I want to remove it from the list.</p>

<p>I tried something like this:</p>

<pre><code>  $(document).on('click','#save', function(){
   $('#cardList' + 'c').remove();
  });
</code></pre>

<p>But it doesn't work. I think I'm in the right direction though.</p>

<p>Just to re-iterate, this is a card game deck building application... so I want to make it easier on a user by letting them remove a card that's already in their deck just by clicking on the div with the card id. </p>
