i have this html card,which is dynamically rendered inside string…
const showGame = async function(){
try{
const response = await fetch(..link);
const data = await response.json();
const results = data.results;
cosnt markup = results.map(game=>{
let id = game.id;
gameId.push(id);
return `..whole bunch of html strings,this is the card`
}).join('')
container.insertAdjacentHTML('afterbegin',markup);
...and so on.
i have this game id,which is 20 integer value.such as -
1. 0: 3498
2. 1: 3328
3. 2: 4200
4. 3: 5286
5. 4: 5679
6. 5: 12020
7. 6: 13536
8. 7: 802
9. 8: 4291
10. 9: 4062
11. 10: 3439
12. 11: 28
13. 12: 4286
14. 13: 13537
15. 14: 1030
16. 15: 2454
17. 16: 11859
18. 17: 3070
19. 18: 3939
20. 19: 4459
now how would you assign each of these values to each of those html cards,which will be used for an event listener?