am basically looking for a way in jquery where my script will wait 15seconds or so, and display a correct ans if the user hasnt selected an answer already. at the moment it just seems to run straight through. ps this method is called in a for loop, with other methods/functions so it runs straight through iterating through the array. thr for loop is placed below although appears further up in the actual script. to be clear am looking for a wa for the script to check if within those 15seconds the user has clicked a button. at the moment its not even doing that. there are about 10 items in the array, but once the start button is clicked to start the quiz it iterates straight through right to the last item, so the user doesnt even get to make a choice. setTimeout i dont think i appropriate here...tried it but theres a huge poss i cld be wrong
function getUserResp(){
$("#countdown").countdown({seconds: 15});
setTimeout("dispAns()", 16000);
$("#ans1").click(function(){
ansStr=$(this).text();
checkAns(ansStr);
});
$("#ans2").click(function(){
ansStr=$(this).text();
checkAns(ansStr);
});
$("#ans3").click(function(){
ansStr=$(this).text();
checkAns(ansStr);
});
$(".ans").mouseover(function(){
$(this).addClass("hilite").fadeIn(800);
});
$(".ans").mouseout(function(){
$(this).removeClass("hilite");
});
}
$.each(qArr, function(i){
getAns(i);
getQuestion(i);
presentData();
getUserResp();
displayAnsResp();
});
getTotalScore();
});