jQuery remove doesn't work correctly, jquery 1.7.2
<p>I have this HTML5 code (for example):</p>

<pre><code>  &lt;form id="peopleFormView"&gt;
     &lt;input type="checkbox" name="name1" value="5" /&gt;
     &lt;input type="checkbox" name="name3" value="2" /&gt;
     &lt;input type="checkbox" name="name4" value="3" /&gt;
  &lt;/form&gt;

  &lt;table id="domain5"&gt;
     &lt;tbody&gt;&lt;/tbody&gt;
  &lt;/table&gt;
</code></pre>

<p>this code is handled with JS:</p>

<pre><code> $(function(){
   registerPerformersClickHandler();
 });

 function registerPerformersClickHandler(){

   $('#peopleFormView input').click(function(){
     var IdPerson = $(this).val();

     if ($('#performer'+IdPerson).length == 0){
         performer.add(IdPerson);
     }
     else{
         performer.del(IdPerson);
     }

 });

 var performer = {
     del: function(IdPerson){
       $('#performer'+IdPerson).remove();
    }
 }
</code></pre>

<p>Recognition that element exists $('#performer'+IdPerson).length == 0  work fine, but when the element is added </p>

<pre><code>  &lt;tr id="performer5"&gt;
    &lt;td&gt;Surname name&lt;/td&gt;
  &lt;/tr&gt;
</code></pre>

<p>and I click again to the same input, JS correctly calls performer.del(), but nothing happen, no error, no reaction. If I call remove twice like this:</p>

<pre><code>var performer = {

 add: function(IdPerson){
    var requestData = {
        className : 'Performer',
        method : 'getPerformerRowView',
        params : IdPerson
    };

    $.post(openAjaxLoader, requestData)
       .success(function(data){
          orchestraDomain.addPerformerToDomain(data.IdDomain, data.performer);
       })
       .error(function(data){
          window.alert(data.error);
       })
 }
 ,
 del: function(IdPerson){
    alert( $('[id=performer'+IdPerson+']').length ); 
    $('#performer'+IdPerson).remove();
    $('#performer'+IdPerson).remove();
 }

}

var orchestraDomain = {

 addPerformerToDomain: function(IdDomain, performer){
     $('#domain'+IdDomain+' tbody').append(performer);
 }

}
</code></pre>

<p>.. it works. If the call is in this way</p>

<pre><code> var performer = {
     del: function(IdPerson){
       $('#performer'+IdPerson).remove().remove();
    }
 }
</code></pre>

<p>.. it doesnt work. I dont see a problem, seeing someone of you?</p>

<p>:: Is there any kind of magic, don't you think?</p>
