87,993
社区成员
发帖
与我相关
我的任务
分享<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript">
function AS_sleep(n) {
//alert("");
//return;
var start = new Date().getTime();
while(true)
{
if(new Date().getTime()-start > n)
{
break;
}
}
}
function TestFunc(){
document.getElementById("tipinfo").innerText="1";
AS_sleep(500);
document.getElementById("tipinfo").innerText="2";
AS_sleep(500);
document.getElementById("tipinfo").innerText="3";
AS_sleep(500);
document.getElementById("tipinfo").innerText="4";
}
</script>
</head>
<body>
<div>
<p id="tipinfo" class="content">thisarea
</p>
</div>
<div>
<a onclick="TestFunc()">
检测
</a>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript">
function TestFunc(){
document.getElementById("tipinfo").innerText="1";
setTimeout(function(){
document.getElementById("tipinfo").innerText="2";
}, 500);
setTimeout(function(){
document.getElementById("tipinfo").innerText="3";
}, 1000);
setTimeout(function(){
document.getElementById("tipinfo").innerText="4";
}, 1500);
}
</script>
</head>
<body>
<div>
<p id="tipinfo" class="content">thisarea
</p>
</div>
<div>
<a onclick="TestFunc()">
检测
</a>
</div>
</body>
</html>