title: Count of Open tabs- Jquery
body: <p>Can you please help me to find out how many tabs already open in a div as I have to limit the open tabs to 2. If the open tabs count is 2 and trying to add one more tab then need to alert ('maximum allowed tabs exceed, close one tab first')?</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
      &lt;meta name="keywords" content="jquery,ui,easy,easyui,web"&gt;
      &lt;meta name="description" content="easyui help you build your web page easily!"&gt;
      &lt;title&gt;jQuery EasyUI Demo&lt;/title&gt;
      &lt;link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/default/easyui.css"&gt;
      &lt;link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/icon.css"&gt;
      &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"&gt;&lt;/script&gt;
      &lt;script&gt;
          function addTab(title, url){
  
  
              if ($('#tt').tabs('exists', title)){
                  $('#tt').tabs('select', title);
              } else {
                  var content = '&lt;iframe scrolling="auto" frameborder="0"  src="'+url+'" style="width:100%;height:100%;"&gt;&lt;/iframe&gt;';
                  $('#tt').tabs('add',{
                      title:title,
                      content:content,
                      closable:true
                  });
              }
          }
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div style="margin-bottom:10px"&gt;
          &lt;a href="#" class="easyui-linkbutton" onclick="addTab('google','http://www.google.com')"&gt;google&lt;/a&gt;
          &lt;a href="#" class="easyui-linkbutton" onclick="addTab('jquery','http://jquery.com/')"&gt;jquery&lt;/a&gt;
          &lt;a href="#" class="easyui-linkbutton" onclick="addTab('easyui','http://yahoo.com')"&gt;easyui&lt;/a&gt;
      &lt;/div&gt;
      &lt;div id="tt" class="easyui-tabs" style="width:400px;height:250px;"&gt;
          &lt;div title="Home"&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>