我正在尝试选择标签并将其存储在rendor()中的新数组中,并将其存储在JS中,方法是使用.map-function,其中对象是该API {{3 }} hand []从该API存储卡的所有对象 随时问任何问题。
function render(hand) {
hand.map(
card => `
<div class="cards data-idx="${index}"">
<img src="${card = hand[count].cards[0].image}">
</div>
`)
.join("");
const displayedCards = [...document.querySelectorAll(".cards")];
displayedCards.map(card => card.addEventListener("click", selectCard));
}
function selectCard() {
const index = this.dataset.idx;
emojiResults[index].selectCard = true;
render();
}
function filterCards() {
hand = [...hand];
render(render.filter(card => card.selected));
}