document.body.addEventListener(
"command",
(event) => {
const theButton = event.source;
theButton.classList.add("just-pressed");
setTimeout(() => {
theButton.classList.remove("just-pressed");
}, 1000);
},
{ capture: true },
);CommandEvent: source property / notebook
CommandEvent: source property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.