(I’m creating a blackjack game btw.)1)Whenever I create an element inside a function that will be executed by an eventlistener, it says what the picture says.
Also, When I assign a variable like this inside a function.
instead of this way
I just want it to where when I click on the “Start game” button, the button “Draw a card” will get deleted, and a new button called “draw a card” will spawn in. that is where I’m at rn.
Should be simple to do this but it isn’t because the damn trash createElement doesn’t work inside the function, yayayay.
I appended the created element to the ContainerForButton variable(which is referencing “ForButton”) but it didn’t do anything.