()
| 104 | } |
| 105 | } |
| 106 | function flipCard() { |
| 107 | |
| 108 | const cardId = this.getAttribute("data-id"); |
| 109 | cardChosen.push(cardArray[cardId].name); |
| 110 | cardChosenId.push(cardId); |
| 111 | console.log(cardChosen); |
| 112 | console.log(cardChosenId); |
| 113 | this.setAttribute("src", cardArray[cardId].img); |
| 114 | |
| 115 | if (cardChosen.length === 2) { |
| 116 | setTimeout(checkMatch, 500) |
| 117 | } |
| 118 | } |