// HTML attribute <button onclick="handleClick()">Click</button> // DOM property button.onclick = function() { }; // addEventListener (recommended) button.addEventListener('click', function() { });
Generating explanation with Claude AI...
This will use 10 credits