title: Jquery Multi Delete Objects
body: <pre><code>function clear(node) {
    if (Obj != null) {
      $.each(Obj, function(key, val) {
        if ($('#selectable li#' + key).length == 1) {
          $('#selectable li#' + key).replaceWith('&lt;span id="' + key + '"&gt;&lt;/span&gt;');
        }
      });
    }
  }
  </code></pre>
  
  <p>With this Function i can "delete" one Objects in the List, when it's the only one. Then i just replace the list with a empty span.</p>
  
  <pre><code>if ($('#selectable li#' + key).length &gt; 1) {
    $.each($('#selectable li#' + key + 'a'), function(k, v) {
      var href = $(v).attr('href');
      if (endsWith(href, val)) {
        $(v).parent().remove();
      }
    });
  }
  </code></pre>
  
  <p>This is how i delete one Object from the List, now i am trying to select 2 Objects and delete them but i cant success in that. I tryied something like this:</p>
  
  <pre><code>if ($('#selectable li#' + key).length &gt;= 2) {
    $.each($('#selectable li#' + key + 'a'), function(k, v) {
      var href = $(v).attr('href');
      if (endsWith(href, val)) {
        $(v).parent().remove(('#selectable li#' + key).length);
      }
    });
  }
  </code></pre>
  
  <p>Thanks for Support</p>