Using leafletjs I created a series of markers on the map, all looping from a JavaScript array. I also added some html, including the "I'm here" button as per the screen. I would like to be able to access that button to create a series of events. My idea was to increase a number present in the paragraph again via JS.
How can I do?
luoghi.forEach(function (info) {
let marker = L.marker([info.latitudine, info.longitudine], { icon: iconaPedone });
let infoLuogo =
`
<div class="box-informazioni">
<h3 class="nome-scheda">${info.nome}</h3>
<p class="linea-p"></p>
<p>Tipo: lxxuogo comune o circolo</p>
<p>Aperto da: <strong>LUN-VEN ore 10-18</strong></p>
<p class="giocatori-presenti">Giocatori presenti: <strong>10</strong></p>
<div class="box-pulsanti">
<a class="link-segnalazione" href="#">Sono qui</a>
<a class="link-coordinate" href="https://www.google.com/maps/place/${info.latitudine},${info.longitudine}">Vai al luogo</a>
</div>
</div>
`;
let gpsLuogo = infoLuogo.toString();
marker.bindPopup(gpsLuogo);
marker.addTo(map);
});