<button>Click</button>
const button = document.querySelector('button');
button.addEventListener('click', event => {
button.textContent = `Click count: ${event.detail}`;
});
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.