Brackets run the function instead of passing it to the listener.
Acceptance criteria
- 1.Clicking the button should make #out show Clicked.
Brackets run the function instead of passing it to the listener.
function handle() { document.querySelector('#out').textContent = "Clicked"; } document.getElementById("btn").addEventListener("click", handle()); document.querySelector('#out').textContent = "ran too early";
Output ready when you are
Press Run to render your code, or Submit to validate your solution.