<html> <head> <script type="text/javascript" src="js/jquery-1.3.2.js"></script> <script type="text/javascript"> $(document).ready(function(){ alert($("*").index( $('#foobar')[0] )); }); </script> </head> <body> <body> <div id="foobar"><b></b><span id="foo"></span></div> </body> </html>