<!DOCTYPE html>
<html>
<head>
<style>
body { cursor:pointer; min-height: 100px; }
div { width:50px; height:30px; margin:5px;
float:left; background:blue; }
span { color:red; }
</style>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<span></span>
<div></div>
<script>
$(document.body)
.click(function() {
$(this).append( $("<div>") );
var n = $("div").size();
$("span").text("There are " + n + " divs. Click to add more.");
})
// trigger the click to start 本来只有一个,页面已载入事件就已经触发,显示2个
.click();
</script>
</body>
</html>