Welcome to CODEBOX! (Copy 1273)
✨ POLARIS KK
<html> <head> <title>Let's Start</title> <style> body{ background:#eee; margin:1em; font-family:sans-serif; } .grid{ display:flex; flex-wrap:wrap; height: 300px; width: 400px; } </style> </head> <body> <h3> Score: <span id="reslt"></span> </h3> <div class="grid"> </div> </body> <script> const cardArray = [ { name: 'threeofsword', img: "url('https://i.pinimg.com/564x/e0/e3/25/e0e3259b4d7b44444e33dbc1b05b8aa2.jpg')" }, { name: 'threeofsword', img: "url('https://i.pinimg.com/564x/e0/e3/25/e0e3259b4d7b44444e33dbc1b05b8aa2.jpg')" }, { name: 'themoon', img: "url('https://i.pinimg.com/564x/53/a5/5c/53a55c0eb2675fcdd3cd0eab4bdf5d94.jpg')" }, { name: 'themoon', img: "url('https://i.pinimg.com/564x/53/a5/5c/53a55c0eb2675fcdd3cd0eab4bdf5d94.jpg')" }, { name: 'thehighpritess', img: "url('https://i.pinimg.com/564x/d1/d9/c3/d1d9c3147c74dee7acc3f357a5061f3a.jpg')" }, { name: 'thehighpritess', img: "url('https://i.pinimg.com/564x/d1/d9/c3/d1d9c3147c74dee7acc3f357a5061f3a.jpg')" }, { name: 'pageofcoin', img: "url('https://i.pinimg.com/564x/2a/94/10/2a9410410d55c77edae3c3925951e780.jpg')" }, { name: 'pageofcoin', img: "url('https://i.pinimg.com/564x/2a/94/10/2a9410410d55c77edae3c3925951e780.jpg')" }, { name: 'tenofcoin', img: "url('https://i.pinimg.com/564x/33/4e/ec/334eecff5de1c7a87b6438ecf3957612.jpg')" }, { name: 'tenofcoin', img: "url('https://i.pinimg.com/564x/33/4e/ec/334eecff5de1c7a87b6438ecf3957612.jpg')" }, { name: 'twoofcoin', img: "url('https://i.pinimg.com/564x/32/22/d3/3222d3cf87beaf7216c30bbd407ba3d4.jpg')" }, { name: 'twoofcoin', img: "url('https://i.pinimg.com/564x/32/22/d3/3222d3cf87beaf7216c30bbd407ba3d4.jpg')" } ] const grid = document.querySelector('.grid') function creteBoard(){ for(let i = 0; i< cardArray.length; i++){ var card = document.createElement('img') card.setAttribute('src', 'url("https://i.pinimg.com/564x/69/c1/26/69c1260199721ee6408023be0d9d121b.jpg")') card.setAttribute('data-id', i) //card.addEventListener('click', flipcard) grid.appendChild(card) } } createBoard() </script> </html>