i'm trying to use the addeventlistener fuction on a button but it is not working properly. this is my html
<main class="main">
<div class="start" >
<button id="star" >Start Quiz</button>
</div>
and this is my script
var btn=document.getElementById("star");
btn.addEventListener("click",alert("Your time has started"))\`
the addEventlistener executes as soon as i refresh the page after that it does not run anymore.
I tried replacing the addEventListener with the onclick()function but still the same result.i dont understand what's happening.i am not getting any error as well