79567270

Date: 2025-04-10 17:47:18
Score: 1
Natty:
Report link

Try to insert return false; after calling the alert function (I think addEventListener expects a return in this case):

<button id="myBtn">Click me</button>

document.getElementById("myBtn").addEventListener("click", function() {
    alert("Button clicked!");
    return false;
});

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Eddi