title: How to find the highest z-index within a document no matter what tags they are?
body: <p>How can I find the highest z-index within a document no matter what tags they are?</p>
  
  <p>I found this code but I tested it and it does not work,</p>
  
  <pre><code>//include jQuery.js --  visit: http://jquery.com/
  $(function(){
      var maxZ = Math.max.apply(null,$.map($('body &gt; *'), function(e,n){
             if($(e).css('position')=='absolute')
                  return parseInt($(e).css('z-index'))||1 ;
             })
      );
      alert(maxZ);
  });
  </code></pre>
  
  <p>Any better approach to do this?</p>
  
  <p><strong>EDIT:</strong> </p>
  
  <p>It seems to work if I change the code to this,</p>
  
  <pre><code>$('body *')
  
  $('body &gt; *') --&gt; is for div only I guess.
  </code></pre>