Closed dvfrancis closed 2 hours ago
This is the code I amended to auto-generate the id name based on array position:
cards[cardIndex].innerHTML = `
`;
However, looking at this in the browser it appears the name is not generating as I expected:
The ID there should be card-1, card-2, etc.
I needed to simplify the code to just use the currentCard variable (which stores the index of the currently flipped card).
cards[cardIndex].innerHTML = `
`; // Flip the next card
Now the cards are targeted by the CSS correctly, and display at their correct size.
Renamed some classes and IDs to help in coding but now cards are not resizing correctly when flipped.