0
Is there something wrong with my code
if (a === 50) { var upgradeOne = document.createElement("button"); upgradeOne.onclick = "newUpgrade()"; upgradeOne.innerHTML = "Would You Like To Upgrade?"; document.body.appendChild(upgradeOne.); }
5 odpowiedzi
+ 2
,
your code seems to be incomplete. this makes it difficult to help.
read the error messages you get when code is executing. try to solve the issues step by step.
0
What if the person wants to upgrade, but a is 72?
0
I think it is a syntax error:
document.body.appendChild(upgradeOne.);
It should be: document.body.appendChild(upgradeOne);
also Instead of upgradeOne.onclick = "newUpgrade()";
should be upgradeOne.onclick = newUpgrade;
here is the full code:
if (a === 50) {
var upgradeOne = document.createElement("button");
upgradeOne.onclick = newUpgrade;
upgradeOne.innerHTML = "Would You Like To Upgrade?";
document.body.appendChild(upgradeOne);
}
I hope it work: J
0
It still doesn’t fix the point I described earlier.
0
I fixed it for the most part thank you