新手一枚,很简单的程序调了几天没结果,求大神赐教
现在主要的问题是点check没有反应,跪求大神赐教<html>
<head>
<title>这是一个关于javascript的smallcase</title>
<script language="JavaScript">
<!--
function comeback(){
var year1="儿童";
var year2="少年";
var year3="青年";
var year4="中年";
var year5="老年";
var commonword1="您填写的年纪是:";
var commonword2="岁,您属于:";
var yearx=parseInt(document.myForm1.year.value);
if(yearx<=12)
document.myForm2.output.value=commonword1+yearx+commondword2+year1;
else if(yearx<=16)
document.myForm2.output.value=commonword1+yearx+commondword2+year2;
else if(yearx<=35)
document.myForm2.output.value=commonword1+yearx+commondword2+year3;
else if(yearx<=50)
document.myForm2.output.value=commonword1+yearx+commondword2+year4;
else if(yearx>50)
document.myForm2.output.value=commonword1+yearx+commondword2+year5;
else if(yearx<0||yearx>150)
alert("填写有误");
}
//-->>
</script>
</head>
<body>
请输入您的年纪:
<form name="myForm1">
<input type="text" name="year" size="10" value=" ">
</form>
<table>
<tr><td><b>关于年龄的说明</b></td></tr>
<tr><td><font color="0000ff">十二岁以下,属于儿童</td></tr>
<tr><td><font color="0000ff">十二岁以上,十六岁以下,属于少年</td></tr>
<tr><td><font color="0000ff">十六岁以上,三十五岁以下,属于青年</td></tr>
<tr><td><font color="0000ff">三十五岁以上,五十岁以下,属于中年</td></tr>
<tr><td><font color="0000ff">五十岁以上,属于老年</td></tr>
</table>
<form name="myForm2">
<input type="button" name="mybutton" onclick="comeback()" value="check">
<input type="text" name="output" size="40" value="此处查看结果">
</form>
</body>
</html>