The code is supposed to redirect the user to another internal page. However when the page loads with the code in it it automatically redirects the user without the user having to click the button.
I'm pretty new. I don't know what to try. I think it should work as is.
document.querySelector(".choice").addEventListener('apple', Redirect());
function Redirect()
{
window.location = "challenge.html";
}
The expected result is that the user would click the text that contain the choice class and it would redirect the user to the challenge page.
The actual result is when the page loads it automatically redirects the user to the challenge page without the user having to click the button.