I'm new to JS, currently learning it and need your help. Below is just a sample of some code I came up with, and my question is: Which OF THE FOLLOWING is a valid statement for assigning the JS click events?
a. mButtons.forEach(e => e.click = process);
b. mButtons.forEach(e => e.onAction = process);
c. mButtons.forEach(e => e.onclick = process);
d. mButtons.forEach(e => e.onProcess = process);
e. None of the ABOVE
<body>
<button>1</button>
<button>2</button>
<button>3</button>
<script>
let buttons = documnet.querySelectorAll("button");
let mButtons = Array.from(buttons);
const process = function () {
console.log({
question: 17,
date: new Date(),
label: this.innerText
});
}
</script>
</body>