页面加载后10秒更改布尔变量

时间:2017-10-30 12:21:09

标签: javascript

我怎样才能让它真实,然后在10秒后,它将变为假?

MemoryGame.Card = function(value) {
this.value = value;
this.isRevealed = false;

this.reveal = function() {
this.isRevealed = true;
}

this.conceal = function() {
this.isRevealed = false;
}
};

1 个答案:

答案 0 :(得分:0)

您可以查看Window setTimeout() Method。所以你的代码可能是这样的:

window.setTimeout(function() { conceal(); }, 10000);
相关问题