35
rated 0 times
[
39]
[
4]
/ answers: 1 / hits: 27663
/ 12 Years ago, sun, july 1, 2012, 12:00:00
Got a problem. this is my code:
<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>
When I click the submit-button, the 'correct/wrong' shows only for a moment. I want it to stay on the site, any advice?
More From » javascript