[.js] no category
1초에 한번 함수 실행
혜화초보
2017. 9. 6. 17:03
<html>
<head>
</head>
<script language="javascript" >
var aa = 0;
function exe(){
aa = setInterval("roofing_func()", 1000); // 1000 = 1초 1초마다 roofing_func 를 실행하라.~
}
function stop(){
clearInterval(aa);
}
function roofing_func(){
console.log( 'a');
}
</script>
<body >
<div style=" height:80px ; padding-top:200px ; padding-left:200px " >
<a href="javascript:exe();" > click </a>
<a href="javascript:stop();" > stop </a>
</div>
</body>
</html>