Does this code do anything?

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!

1 Like

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.