【发布时间】:2015-05-02 13:27:44
【问题描述】:
我收到一条提醒,提示您是对/错。我想放置一个会出现几秒钟而不是警报的 div。 So when the right/wrong answer is chosen this div will appear instead of the alert.我知道需要一个超时功能,但我似乎无法让它工作。我已经尝试了几次,但没有什么对我有用。有谁知道我会怎么做?
这是html(div)
<div id = "your wrong">
wrong answer!
</div>
<div id = "right answer">
Right answer!
</div>
这是警报的 javascript
function characterclicked(nr) {
if (nr == oddoneout[currentQuestionIndex].answer) {
alert("You're right!");
score+= 200;;
}
else{
alert("you are wrong it was " + oddoneout[currentQuestionIndex].characterName);
}
nextQuestion();
}
【问题讨论】:
标签: javascript html function time