Does the following code usually work? I’m genuinely wondering if it does or if something else is causing it to break.
The code: const element = document.getElementById(“victory”, “defeat”, “bullyattack”);
Does the following code usually work? I’m genuinely wondering if it does or if something else is causing it to break.
The code: const element = document.getElementById(“victory”, “defeat”, “bullyattack”);
This will show an error because the getElementById function only takes one argument at a time.
So you’ll want, for example:
const element = document.getElementById(“victory”)
const element2 = document.getElementById(“defeat”)
const element3 = document.getElementById(“bullyattack”)
Holy shit! I never realized that! Thanks! I’ll try it out!
for curiosity’s sake, did the original code snippet come from AI?
You’re not wrong. It looks like something AI would do.
Even if it messes up, I still want to give it a shot, lol.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.