Hi, i wanted to expand my simple score keeper project by tracking the number of wins of both players. However, when i added those simple variables to track the number of wins in my “whenWin” function, the application stopped working properly.
My question is, why does adding such seemingly innocuous code cause such unexpected changes?
Also, i tried to put the my HTML in a flex container with the id “container” and the content got scrambled up and disorganised for some reason (its currently commented out aswell)
I would appreciate some help, thank you!
p1WinsSpan.textContent = p1Wins;
You need to check the console, because you are getting errors showing there if you uncomment the new code sections you added. You have two typos in the new code you added which are causing the problems.
Thank you, that was a silly mistake! What about in regard to the flex container, do you know why it jumbles up the content like that?
Since I don’t know how you want the layout to be of the elements, I do not know what advice to give you about how to use the flexbox.
Have you read or watched any Flexbox tutorials yet? My recommendation is to do that before trying to use it.
Different elements are displayed differently by default: headings (h1-h6) are displayed on a new row, but buttons and inputs on the same row.
When you set
display: flex it overrides those default settings. By default
flex sets everything on one row.