title: jquery: if ul is empty
body: <p>Okay I have a jQuery dialog box which has a form in it and I am at my wits end trying to figure this out... Lets see if I can verbalize what I am trying to do..</p>
  
  <p>I have 3 text boxes.  <code>#apInterest</code>, <code>#apPayment</code> and <code>#apPrincipal</code> in that exact order.</p>
  
  <p>basic english terms of what i am trying to do:</p>
  
  <p>on keyup in <code>#apInterest</code> if <code>.val</code> is less than 0 or greater than 99.99 trigger an error.. else check <code>ul#mylist</code> if it has any <code>li</code>, if not <code>.hide</code></p>
  
  <p>on keyup in <code>#apPayment</code> if <code>.val</code> is less than 0 trigger an error else check the list for <code>li</code> hide if not.</p>
  
  <p><code>#apPrincipal</code> is the same thing exactly as <code>#apPayment</code></p>
  
  <p>what I have right this moment</p>
  
  <pre><code>$('#apInterest').live("keyup", function(e) {
  var parent = $('.inter').parents("ul:first");
  if ($('#apInterest').val() &lt; 0 || $('#apInterest').val() &gt; 99.99) {
      $('.inter').remove();
      $('#mylist').append('&lt;li class="inter"&gt;Interest Rate cannot be below 0 or above 99.99&lt;/li&gt;');
      $('#popuperrors').show();
      $(this).addClass('error');
  } else {
      $(this).removeClass('error');
      $('.inter').remove();
      alert(parent.children().text);
      if (parent.children().length == 0){
          $('#popuperrors').hide();
      }
  }
  });
  </code></pre>
  
  <p>Although I have also tried </p>
  
  <pre><code>if ($("#mylist :not(:contains(li))") ){
  $('#popuperrors').hide();
  }
  </code></pre>
  
  <p>I had a function similar to this for all 3 textboxes but none of what I have tried seems to work..  any ideas on how to complete this</p>