1.src代表外部脚本文件的路径,type用来指定HTML中使用的脚本语言及其版本。
代码1:
<html>
<head>
<script type="text/javascript" src="jquery-3.2.1.min.js"></script>
<script type="text/javascript">
var a=1+2;
alert("A:"+a);
</script>
</head>
<body>
<script type="text/javascript">
</script>
</body>
</html>
代码二:9*9乘法口诀表
<html>
<head>
<script type="text/javascript" src="jquery-3.2.1.min.js"></script>
<script type="text/javascript">
var i,j;
document.write("<table boder=1>");
for(i=0;i<10;i++){
document.write("<tr>");
for(j=1;j<i;j++){
document.write("<td>");
document.write(" "+j+"x"+i+"="+j*i );
document.write("<td>");
}
}
docuemnt.write("</table>");
</script>
</head>
<body>
<script type="text/javascript">
</script>
</body>
</html>
运行结果: