<html>
<body>
<script type="text/javascript">
document.write("<h1>关于分号</h1>");
document.write("<p>可以有</p>");
document.write("<p>也可以没有</p>")
document.write("<p>但是</p>");document.write("<p>一行之间分号的必须有</p>")
//document.write("<p></p>");
</script>
</body>
</html>
分号是语句结束的标志,但是因为浏览器会将行末作为语句的结束。所以就会看到有些分号可有可无。
但是,值得注意的是:通过使用分号,才可以在一行中写多条语句。当然最后一句的分号可以省去。