<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/type"; charset="utf-8"/>
<title>消息对话框</title>
</head>
<body>
<script type="text/javascript">
function rec(){
var =tong;
tong =prompt("请输入你的年龄?");
if (tong>=18){
document.write("你已经成年");
}else{
document.write("你未成年");
}
}
</script>
<form>
<input name="button" type="button" onClick="rec()" value="点击输入你的成绩" />
</form>
</body>
</html>
var =tong; tong =prompt("请输入你的年龄?"); //应该改为var tong =prompt("请输入你的年龄?"); //var =tong; 本身定义就错了,多了等于号