안녕하세요, 제가 javascript
과 관련된 몇 가지 문제를 겪고 있으며, 저를 도울 수 있는지 궁금합니다.자바 스크립트에 간단한 제출이 작동하지 않습니다.
이 내 HTML
코드
<div class="Answer1">
<form name="form">
Enter your answer here :
<input type="text" size="10" name="answer" value="">
<input type="button" value="Check" onclick="result();">
</form>
</div>
<!--2st sum -->
<div class="Answer2">
<form name="form">
Enter your answer here :
<input type="text" size="10" name="answer" value="">
<input type="button" value="Check" onclick="result2();">
</form>
</div>
내가 그것을 완벽하게 잘 작동이 중 하나를 주석 경우,이 내 javascript
function result() {
var score = (document.form.answer.value);
if(score == 8) {
document.location.href="CorrectAdditionAnswer.html"
} else {
document.location.href="IncorrectAddition.html"
}
}
function result2() {
var score = (document.form.answer.value);
if(score == 8) {
document.location.href="CorrectAdditionAnswer2.html"
} else {
document.location.href="IncorrectAddition.html"
}
}
하지만 그 댓글을 달았없는 경우가 나던 일 : (나는 ive가 잘못한 것을 이해하지 않는다 :(
당신은 ** 리디렉션 할 수 없습니다와 ** 당신이이 당신이 또한 getElementByID – Ian
는이 양식을 제출 'name = "answer"를 사용하여 입력 시간을 늘리십시오. – Ligth
으로 시도 – AndreM96