有问题。这是我的代码:
<html>
<body>
<form>
<p>13-7: <input id="in1" type="text"" /><input type="submit" onclick="check(6, 'in1', 'out1')" value="Tjek!"/></p>
<p id="out1"></p>
<p>20-7: <input id="in2" type="text"" /><input type="submit" onclick="check(13, 'in2', 'out2')" value="Tjek!" /></p>
<p id="out2"></p>
<script type="text/javascript">
function check(facit, input, output) {
var answer, evaluation;
answer = document.getElementById(input).value;
evaluation = (answer == facit) ? "Correct" : "Wrong";
document.getElementById(output).innerHTML = evaluation;
return false;
}
</script>
</form>
</body>
</html>
当我单击提交按钮时,“正确/错误”仅显示片刻。我希望它留在网站上,有什么建议吗?