这显示错误,不知道为什么。
function display() {
getMPS();
getDMaxCost();
getSMaxCost();
getMMaxCost();
var mps = document.getElementById("mps");
mps.innerHTML("You are getting " + player.mps + " layers per second.");
var money = document.getElementById("money");
money.innerHTML(player.money);
var dCost = document.getElementById("dCost");
dCost.innerHTML("Cost: " + player.dCost);
var dMax = document.getElementById("dMax");
dMax.innerHTML("Max buy. Buying: " + player.dMaxAmt + ". Cost: " +
player.dMaxCost);
var dAmt = document.getElementById("dAmount");
dAmt.innerHTML(player.dAmount);
var sCost = document.getElementById("sCost");
sCost.innerHTML("Cost: " + player.sCost);
var sMax = document.getElementById("sMax");
sMax.innerHTML("Max buy. Buying: " + player.sMaxAmt + ". Cost: " +
player.sMaxCost);
var sAmt = document.getElementById("sAmount");
sAmt.innerHTML(player.sAmount);
var mCost = document.getElementById("mCost");
mCost.innerHTML("Cost: " + player.mCost);
var mMax = document.getElementById("mMax");
mMax.innerHTML("Max buy. Buying: " + player.mMaxAmt + ". Cost: " +
player.mMaxCost);
var mAmt = document.getElementById("mAmount");
mAmt.innerHTML(player.mAmount);
}
这是错误:
未捕获的TypeError:mps.innerHTML不是函数
我正在尝试更改我的游戏网站上的文字,非常感谢帮助。我不知道要包含哪些其他信息,但如果您需要,我会包含该网站的链接。 https://merp101.github.io/
请帮帮我。
答案 0 :(得分:0)
innerHTML
不是函数,是属性,你应该做
mps.innerHTML = "You are getting " + player.mps + " layers per second.";