<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" 
content="text/html; charset=windows-1251" /> 
<style>
  h3, h4 { margin: 0; }
  div,span,p {
    width: 85px;
    height: 40px;
    float:left;
    padding: 10px;
    margin: 10px;
    background-color: #EEEEEE;
	border:1px solid #AAAAAA;
  }
  #log { 
    clear:left; 
    border:1px solid #6796E1; 
	width: 340px; 
	height: auto;
}
</style>
<script type="text/javascript" 
 src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">
</script> 
</head>
<body>
  <div>DIV</div>
  <span>SPAN</span>
  <p>P <button>Button</button></p>
  <div id="log"></div>
<script>
var elementCount = $("*").length;
var text = "<h3>Количество найденных элементов: " 
         + elementCount + "</h3>";
$("*").each(function(i){
    text += '<h4>' + i + "). " + this.tagName;
    if (this.id) text += '#' + this.id;
    text += '</h4>';
  });
$("#log").html(text);
</script>
</body>
</html>