title: jQuery can't access a DOM element using ID but can with .class
body: <p>I posted a similar question earlier and received some good suggestions.  After further investigation, I found that the behavior is different enough to warrant a new question.</p>
  <p>I am looking for suggestions as to the best way to debug some odd jQuery behavior.</p>
  <p>The following code sample works as expected <a href="http://jsfiddle.net/x27Y9/" rel="noreferrer">here</a> when appending to the ul by either ID or class reference.</p>
  <pre><code>&lt;input type=&quot;submit&quot; id=&quot;submitID&quot; value=&quot;ID&quot; /&gt;
  &lt;input type=&quot;submit&quot; id=&quot;submitClass&quot; value=&quot;Class&quot; /&gt;
  
  &lt;ul id=&quot;myList&quot; class=&quot;myClass&quot;&gt;
      &lt;li&gt;first list item&lt;/li&gt;
      &lt;li&gt;second list item&lt;/li&gt;
      &lt;li&gt;third list item&lt;/li&gt;
  &lt;/ul&gt;
  
  &lt;script&gt;
      $('#submitID').click(function(){
          $('#myList').append('&lt;li&gt;fourth list item&lt;/li&gt;');
      });
  
      $('#submitClass').click(function(){
          $('.myClass').append('&lt;li&gt;fourth list item&lt;/li&gt;');
      });
  &lt;/script&gt;
  </code></pre>
  <p>However, in my application, I am unable to append using the #myList ID reference and I can't figure out why.  I am dynamically rendering the ul and li elements and I have tried, as suggested, to use the following approach instead of the click event:</p>
  <pre><code>&lt;script&gt;
      $('#submitID').live('click', function(){
          $('#myList').append('&lt;li&gt;fourth list item&lt;/li&gt;');
      });
  
      $('#submitClass').live('click', function(){
          $('.myClass').append('&lt;li&gt;fourth list item&lt;/li&gt;');
      });
  &lt;/script&gt;
  </code></pre>
  <p>In FireBug console, I can interact with the object using .myClass, but not #myList.  For example, typing the following into FireBug console:</p>
  <pre><code>&gt;&gt;$('#myList').hide()
  </code></pre>
  <p>does not hide the #myList element as I would expect.  The console simply returns [].</p>
  <p>Any suggestions are appreciated.</p>