Like how you can.
document.querySelectorAll('div').forEach((div) => {
div.onclick = () => {
console.log(this.dataset.id)
}
});
How can i do it if div was a class .email How can i make it work?
and how can put a class and a dataset thorough Javascript because I created an element.