title: Jquery check if li with id=x exists in ul already
body: <p>I have many UL with li. Different UL will have li with the same id:</p>
  
  <pre><code>&lt;ul&gt;
   &lt;li id='1'&gt;this&lt;/li&gt;
   &lt;li id='2'&gt;that&lt;/li&gt;
  &lt;/ul&gt;
  
  &lt;ul&gt;
   &lt;li id='1'&gt;this&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>The user can drag li from on list to the other but only if the li with the same id does not exist. So far I have this:</p>
  
  <pre><code>$(".container").droppable({
          drop: function (event, ui) {
              var a = $(this).find("li").attr("id", $(ui.draggable).attr('id'));
              if (a.length == 0) {
                  $.ajax({
                      ...
                  });
              }                
          }
      });
  </code></pre>
  
  <p>However when I drop the draggable it changes the id of all li to the value of the dropped li. </p>
  
  <p>Any guidance would be great. Thanks.</p>