title: jquery ignore child elements
body: <p>hi i have a div tag with nested divs as shown below</p>
  
  <pre><code>&lt;div class="friendRequestMenu" id="friendRequestMenu"&gt;
      &lt;div class="toolbarTitle"&gt;
          &lt;span&gt;Friend Requests&lt;/span&gt; &lt;a href="javascript:void(0)" class="hyperlink"&gt;Find Friends&lt;/a&gt;
      &lt;/div&gt;
      &lt;div id="friendRequestData"&gt;
          &lt;!-- put div class=requestli to see a block--&gt;
          &lt;div class="no-request"&gt;
              No New Friend Requests
          &lt;/div&gt;
          &lt;a href="javascript:void(0)"&gt;
              &lt;div class="see-all-requests"&gt;
                  See All Requests
              &lt;/div&gt;
          &lt;/a&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>javascript:</p>
  
  <pre><code>$('*').each(function() {   /getting all elements in document
    // do something for all elements except the div tag above
  });
  </code></pre>
  
  <p>i want the code to apply for everything except for the div tag and its children, i know i can get all the id's and add an exception , but i want to do that with only the parent tag
  thanks
  EDIT:</p>
  
  <p>hi this is exactly what i want to do</p>
  
  <pre><code>$(document.body).find('*:not(#friendRequestMenu):not(#friendRequestMenu *)').each(function () {
  
      var clientWidth = $(window).width();
      var clientHeight = $(window).height();
      var heightPercent = ($(this).height() / clientHeight) * 100;
      var widthPercent = ($(this).width() / clientWidth) * 100;
      $(this).css('height', heightPercent.toString());
      $(this).css('width', widthPercent.toString());
  
  
      });
  </code></pre>
  
  <p>but i want to ignore some elements, as you can see the selector part code isnt working for me</p>