哪里写的不对,求教,代码如下
<script type="text/JavaScript">
var age=99;
if(age<1)
{document.write("孩子孩子;")};
else if(age<10)
{document.write("青少年")};
else if(age<20)
{document.write("qiuzi")};
else
{document.write("go die")};
</script>
<script type="text/JavaScript">
var age=99;
if(age<1)
{document.write("孩子孩子;");}
else if(age<10)
{document.write("青少年");}
else if(age<20)
{document.write("qiuzi");}
else
{document.write("go die");}
</script>
去掉分号
if( ){ } else{ } 没有分号
<script type="text/JavaScript">
var age=99;
if(age<1)
{document.write("孩子孩子;")};
else if(age>=1&&age<10)
{document.write("青少年")};
else if(age>=10&&age<20)
{document.write("qiuzi")};
else
{document.write("go die")};
</script>
分号if() {}else 不是if(){};else
上面不能打分号