秒表计时器的实现:
效果图如下:
附代码,已调试运行
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
#div1 {
width: 300px;
height: 400px;
background: skyblue;
margin: 100px auto;
text-align: center;
}
#count {
width: 200px;
height: 150px;
line-height: 150px;
margin: auto;
font-size: 40px;
}
#div1 input {
width: 150px;
height: 40px;
background: orange;
font-size: 25px;
margin-top: 20px
}