2013 12 14晚的代码测试

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="http://code.jquery.com/jquery-latest.js"></script>
<title>无标题文档</title>
</head>

<body>

<div id="timer" >timeBeginner<span></span></div>
<input type="button"  value="ClickMe" onclick="timer_Click(this)" />
</body>
</html>
<script type="text/javascript">
    function timer_Click(e)
    {
        e.disabled=true;
        var i=6;
        var o=setInterval(function(){
            $("#timer span").html(i);
            if(i==1)
            {
                clearInterval(o);
                e.disabled=false;
            }
            i--;

        },1000);
    }
</script>
原文地址:https://www.cnblogs.com/jiangxiaofan/p/3474818.html