主题:跪求javascript问题
我是在dreamweaver中编译,只能执行第一个script中的内容,第二个script中的if -else都没有执行。
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script language="javascript">
var question="10+20是多少";
var answer=30;
var x3=prompt(question,"0");
</script>
</head>
<body>
<script language="javascript">
if(x3= =answer){
document.write("计算正确");
}else{
document.write("计算错了");
}
</script>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script language="javascript">
var question="10+20是多少";
var answer=30;
var x3=prompt(question,"0");
</script>
</head>
<body>
<script language="javascript">
if(x3= =answer){
document.write("计算正确");
}else{
document.write("计算错了");
}
</script>
</body>
</html>