setInterval都会先预执行一遍,才会去全部执行一遍 财富值12?
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>
精彩评论