选择正确答案后如何使 if 语句停止?我是否需要将其更改为 if else,或者我可以尝试其他什么?
如果
if (!arraysEqual(answerKey, answers)) {
alert('Please Try Again');
return false;
}
if (arraysEqual(answerKey, answers)) {
$("#bin ol").append('<a href="index.html" name="modal"><img id="correct" src="images/visSelect/seq_correct.png"></a>');
return false;
}
});
否则(更新)
if (arraysEqual(answerKey, answers)) {
$("#bin ol").append('<a href="index.html" name="modal"><img id="correct" src="images/visSelect/seq_correct.png"></a>');
return false;
}else{
alert('Please Try Again');
return false;
}