title: jQuery selectors for list elements
body: <p>I am using jQuery and jQuery UI.</p>
  
  <p>Using the getJSON function, we are creating list elements and appending them to an OL element. Here's the code:</p>
  
  <pre><code>$.getJSON("http://localhost/b/t.php", function(data){
  
          $.each(data, function(i, thet){
              //alert(thet.fname)
              var t = '&lt;li class="name" id="p' + thet.pid + '"&gt;' + thet.pid + ' ' + thet.fname + ' ' + thet.lname + '&lt;/li&gt;';
  
              $(t).appendTo("#" + thet.tour + 'list');
  
          });
      });
  </code></pre>
  
  <p>I am trying to select list elements using jQuery. If I manually put a list in the HTML page, it will work. However, programatically appending the list items to an OL, doesn't allow it to select - at least from what I've tried.</p>
  
  <pre><code>$('li:last-child').css({color: 'red', backgroundColor: 'black'});
  </code></pre>
  
  <p>I've tried using ID's and many other multiple selectors, to no avail.</p>
  
  <p>Any ideas?</p>