<%@LANGUAGE="JAVASCRIPT" CODEPAGE="936"%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title><head><script type="text/javascript" >function check(){var score=formal.textfield.value;if(score>=90 && score<100){document.write("A");}else if(score>=75 && score<90){document.write("B");else if(score>=60 && score<75){document.write("C");}else{document.write("D");}}</script></head><body><form id="formal" name="formal" method="post" action=""><p>请输入你的分数: <label> <input type="text" name="textfield" /> </label></p><input type ="button" name="button" value="按钮" onclick="check()"/></p></form></body></html>
1 回答
李晓健
TA贡献1036条经验 获得超461个赞
function check(){ var score=formal.textfield.value; if(score>=90 && score<100) {document.write("A");} else if(score>=75 && score<90) {document.write("B");}//这里少一个 } else if(score>=60 && score<75) {document.write("C");} else{document.write("D");} }
看注释
添加回答
举报
0/150
提交
取消