<html>
<head>
<title>script location in html</title>
<script type="text/javascript"> alert("script in the head tag ");</script>
</head>
<body>
<h1>script location in html</h1>
<script type="text/javascript"> alert("script in the body tag ");</script>
</body>
<script type="text/javascript"> alert("script in the html tag ");</script>
</html>
<head>
<title>script location in html</title>
<script type="text/javascript"> alert("script in the head tag ");</script>
</head>
<body>
<h1>script location in html</h1>
<script type="text/javascript"> alert("script in the body tag ");</script>
</body>
<script type="text/javascript"> alert("script in the html tag ");</script>
</html>
<script type="text/javascript"> alert("script out the html tag ");</script>
以上可以发现,<script>标签放哪都可以是,最少上面的4中情况是可行的了。