title: count the number of existing tabs in jquery?
body: <p>I'm using a dynamic jQuery tab widget to add/remove tabs generated programmatically.</p>
  
  <p>How do I check through jQuery and count how many existing tabs are present in the widget?</p>
  
  <p>I'm using this code, but it doesn't work:</p>
  
  <pre><code>$('#container-1 &gt; ul').tabs('add', tabName, name);
  
  var newTab;
  
  if ($('#container-1 &gt; li').size() &lt; 0) {
      newTab = $(tabName).css('display', 'block')
  } else {
      newTab = $(tabName).css('display', 'none');
  }
  
  newTab.html('&lt;iframe src="ViewPatient.aspx?pname=' + name 
         + '" width="100%" frameborder="0" scrolling="no" height="300"&gt;&lt;/iframe&gt;');
  </code></pre>