title: How can I check if an element has any children elements using jquery?
body: <p>I have a div that is floating left and the other floating right. I want to check if the div that is floating right has children element; if the it don't have any visible element, I want applied and new class to the left div. See below:</p>
  
  <pre><code>&lt;div id="leftContent" class="left "&gt;
      &lt;table&gt;&lt;/table&gt;
  &lt;/div&gt; 
  
  
  &lt;div id="rightContent" class="content"&gt;
      //the dom has no visible element
      //”#ctl00_ContentPlaceHolder1_ somegridView” is not visible     
  &lt;/div&gt; 
  </code></pre>
  
  <p>And I’m using the following script:</p>
  
  <pre><code>$(document).ready(function() {
      if ($(“#ctl00_ContentPlaceHolder1_ somegridView”).lenght = 0) {
  
          $("# leftContent ").removeClass("left");
          $("# leftContent ").addClass("center");
  
  
      }
  });
  </code></pre>
  
  <hr>
  
  <pre><code>div.left
  {
      float: left;
      width: 365px;
      margin-left: 5px;
      padding-left: 2px;
  }
  div.center
  {
      padding: 2px;
      margin: 5px;
      float: none;
      width: 95%;
      clear: both;
  }
  </code></pre>
  
  <p>If <code>div id="rightContent"</code> empty?</p>