效果图:
代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>jquery 点击计数器</title>
</head>
<body>
<div id="countbox">0</div>
<input type="button" onclick="clickBtn()" value="点点点" />
</body>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript">
function clickBtn() {
$("#countbox").text(parseInt($("#countbox").text()) + 1);
}
</script>
</html>