优艾设计网

setInterval都会先预执行一遍,才会去全部执行一遍 财富值12?

优艾设计网 https://www.uibq.com 2023-04-23 09:58 出处:网络 作者:PS百科
1、setInterval都会先预执行一遍,才会去全部执行一遍? 2、<!DOCTYPE html><html><head lang=\"en\"> <meta charset=\"UTF-8\"> <title></title> <script> window.onlo

1、setInterval都会先预执行一遍,才会去全部执行一遍?

2、<!DOCTYPE html>
<html>
<head lang="en">

<meta charset="UTF-8"> <title></title> <script> window.onload = function(){ var bu = document.getElementsByTagName("button")[0]; bu.onclick = function(){ setInterval( function(){ alert("aaa") var AA = document.getElementById("aa"); var BB = docume优艾设计网_设计nt.getElementById("bb").firstChild; AA.appendChild(BB); } ,3000); } } </script>

</head>
<body>
<ul id="aa">

<li>1</li> <li class="cc">楼下的上来</li>

</ul>
<ul id="bb">

<li>2</li> <li>楼上的给我下来别上去</li>

</ul>
<button>点击</button>
</body>
</html>


0

精彩评论

暂无评论...
验证码 换一张
取 消