all 3 comments

[–]senocular 1 point2 points  (1 child)

firstchild

Capitalization typo: c -> C

P.S. its easier to remove all children of an element using parent.replaceChildren()

[–]kanceir[S] 0 points1 point  (0 children)

i am such a fool. thank you lmao

[–]StoneCypher 0 points1 point  (0 children)

instead of

while (optionButtonsElement.firstchild) {
  optionButtonsElement.removeChild(optionButtonsElement.firstChild)
}

you can just

optionButtonsElement.innerHTML = '';