I want to incorporate an e.preventDefault() call in my event listener. My function, "voteNoClick", needs to receive a parameter named "direction". How can I pass both the direction parameter and the event object into the function, allowing me to include e.preventDefault() within it? Whenever I try to add the event "e" as a parameter alongside "direction", it appears that e is perceived as a regular parameter.
I appreciate any help!
document.getElementById('voteButtonNoID').addEventListener('click', voteNoClick(direction));
function voteNoClick(direction) {
// Here is where I intend to insert e.preventDefault()
document.getElementById("voteMessageID").innerHTML = "Waiting for the votes to be tallied...";
voteResults('no',direction);