javascript解释顺序
javascript的解释是从上到下,用到那部分的代码就解释那部分的代码。和html同时进行解释。如下例:
清单1
<div style="color: #073763;"><html> <head> <title>javascript</title> <script type="text/javascript"> | var button1=document.getElementById("button"); |先 button1.onclick = function(){ | alert("you click the button"); | }; </script> </head> <body> <input type="button" id="button" value="click"/> | 后 </body></html>
页:
[1]