I am currently working on a project in Javascript.
I would like to know how to get the ID of a element with a click.
This is my code:
const cercleEl = document.querySelectorAll(".cercle");
cercleEl.forEach((element) => {
const elementId = element.getAttribute("id");
});
document.addEventListener("click", cercleEl);