Answer the question
In order to leave comments, you need to log in
How to write code so that the number of cards is equal to the value in the list when clicked?
<section class="memory-game memory-game-hidden">
<div class="memory-card" data-framework="BELKA">
<img class="front-face" src="img/BELKA.jpg" alt="BELKA">
<img class="back-face" src="img/card-game.svg" alt="Memory Card">
</div>
<div class="memory-card" data-framework="BELKA">
<img class="front-face" src="img/BELKA.jpg" alt="BELKA">
<img class="back-face" src="img/card-game.svg" alt="Memory Card">
</div>
<div class="memory-card" data-framework="CHEREPAHA">
<img class="front-face" src="img/CHEREPAHA.jpg" alt="CHEREPAHA">
<img class="back-face" src="img/card-game.svg" alt="Memory Card">
</div>
<div class="memory-card" data-framework="CHEREPAHA">
<img class="front-face" src="img/CHEREPAHA.jpg" alt="CHEREPAHA">
<img class="back-face" src="img/card-game.svg" alt="Memory Card">
</div>
...еще несколько карточек
<div class="counter-info">
<span class="count">Выбери количество карточек</span>
<ul class="counter-row">
<li value="6"> 6 </li>
<li value="10"> 10 </li>
<li value="14"> 14 </li>
<li value="18"> 18 </li>
</ul>
</div>
Answer the question
In order to leave comments, you need to log in
Greetings!
1) In the click handler, we get the value of the value attribute .
2) Create DOM elements in a loop and append them to an element with a section tag ( https://www.javascripttutorial.net/dom/manipulatin... )
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question