js执行顺序

来源:互联网 发布:excel数据有效性 编辑:程序博客网 时间:2024/06/06 02:38
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题 3</title> <script>(function(){alert(0);})();    alert("1-最先执行"); document.getElementById("top").value = "top";</script> </head> <body onload="alert('4-最后执行');"> <input type="text" value="" id="top">上方<script>    alert("2-接着执行"); document.getElementById("bottom").value = "bottom";</script><input type="text" value="" id="bottom">下面 </body> <script>    alert("3-接着执行"); //document.getElementById("bottom").value = "bottom";//document.getElementById("top").value = "top";</script></html>

0 0
原创粉丝点击