效果图
![这里写图片描述](https://img-blog.csdn.net/20170609171354593?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvU21hbGxfTGVl/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
代码
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div id="app" style="font-size: 100px; text-align: center; color: orange;">1</div>
<input type="button" onclick="start()" value="start" id="st"/>
<input type="button" onclick="stop()" value="stop" id="sp"/>
<script type="text/javascript">
var dt;
var st = document.getElementById('st');
var sp= document.getElementById('sp');
var app = document.getElementById('app');
var i=0;
function start(){
st.disabled = true;
sp.disabled = false
dt = setInterval(function(){
app.innerText = i;
i++
},100);
}
function stop(){
sp.disabled= true;
st.disabled=false
clearInterval(dt)
}
</script>
</body>
</html>