title: Removing li elements from ul
body: <p>Is it possible using JavaScript to dynamically remove just a few li elements from a ul, given the id's of the li elements?</p>
  
  <p>UPDATE about the actual issue: </p>
  
  <p>I've the following list.</p>
  
  <pre><code>&lt;ul id="attributes" data-role="listview"&gt;
      &lt;li id="attrib01"&gt;Attribute1&lt;/li&gt;
      &lt;li id="attrib02"&gt;Attribute2&lt;/li&gt;
      &lt;li id="attrib03"&gt;Attribute3&lt;/li&gt;
      &lt;li id="attrib04"&gt;Attribute4&lt;/li&gt;
      &lt;li id="attrib05"&gt;Attribute5&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>After a ajax request/response, if a particular attribute is "undefined", I want to remove it from the list.</p>
  
  <pre><code>if(typeof data.attrib1 === "undefined")
      $("#attrib01").remove();
  </code></pre>
  
  <p>I've made sure I'm receiving the correct ajax response. So, the problem now is, that when I remove attrib4, attrib[1-3] are being removed as well. Any idea why this might be happening?</p>