時間が2分を超えた場合にタイマーを停止するという条件で、0.5秒ごとに関数を実行するためにJavaScriptでタイマーを設定したい:
私のコード:
function InitialiseCountDown() {
var x =setInterval(function(){
CreateImage();
},500);
if(x== ? ) // what should i do here to make sure the two minites are done
{
ClearInterval(x);
}
}