<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript">
var lastClickTime = new Date();
function doHandler() {
var now = new Date();
if (now.getTime() > lastClickTime.getTime() + 5 * 1000) {
document.getElementById("divShow").innerHTML = new Date().getSeconds();
lastClickTime = now;
}
}
</script>
</head>
<body>
<div style="width: 500px; height: 500px; background-color: Red;" οnclick="doHandler()">
</div>
<div id="divShow"></div>
</body>
</html>
转载于:https://www.cnblogs.com/SmartFramework/archive/2009/07/06/1517569.html