function createMoleField() {
    let img;
    for (let i = 0; i < fieldSize; i++) {
      img = create("img");
      img.draggable = false;
      img.src = "img/mole.png";
      img.setAttribute("data-active", "false");
      img.setAttribute("data-img", "mole");
      img.addEventListener("mousedown", checkClickInGame);
      mole.appendChild(img);
    }
  }
// Same with the mole field, but active=false - moles are hidden. In both fields the images get a data-img attribute (respectively hole or mole) and an event listener, to check the clicks later

Same with the mole field, but active=false - moles are hidden. In both fields the images get a data-img attribute (respectively hole or mole) and an event listener, to check the clicks later
Same with the mole field but active = false - moles are hidden . In both fields the images get a data - img attribute ( respectively hole or mole ) and an event listener to check the clicks later
function createMoleField() {
    let img;
    for (let i = 0; i < fieldSize; i++) {
      img = create("img");
      img.draggable = false;
      img.src = "img/mole.png";
      img.setAttribute("data-active", "false");
      img.setAttribute("data-img", "mole");
      img.addEventListener("mousedown", checkClickInGame);
      mole.appendChild(img);
    }
  }
function createMoleField ( ) { let img ; for ( let i = 0 ; i < fieldSize ; i ++ ) { img = create ( "img" ) ; img . draggable = false ; img . src = "img/mole.png" ; img . setAttribute ( "data-active" , "false" ) ; img . setAttribute ( "data-img" , "mole" ) ; img . addEventListener ( "mousedown" , checkClickInGame ) ; mole . appendChild ( img ) ; } }
Same with the mole field, but active=false - moles are hidden.
Same with the mole field but active = false - moles are hidden .