<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div id="num">
3
</div>
</body>
</html>
<script>
// function times(){
// var Domtimes=Number(document.getElementById("num").innerHTML)
// Domtimes--
// console.log(Domtimes)
// document.getElementById("num").innerHTML=Domtimes
// }
var Odiv=document.getElementById("num")
var alldivtimes=setInterval(function(){
var num=Number(Odiv.innerHTML)
// console.log(num)
// num--
if(num<1){
num=0;
clearInterval(alldivtimes)
Odiv.style.display="none"
}else{
num--;
Odiv.innerHTML=num;
}
},1000)
// times()
</script>