From 54bc72642996751fd78165735aca9f0396a2e77e Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Tue, 23 Jan 2024 21:39:29 -0800 Subject: [PATCH] Update aria-label on button click --- index.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.html b/index.html index c7f283c..b64ae4d 100644 --- a/index.html +++ b/index.html @@ -396,12 +396,14 @@ new ResizeObserver(debounce(() => { const button = event.target; const code = button.closest('pre').querySelector('code').textContent; navigator.clipboard.writeText(code); + button.setAttribute('aria-label', 'Copied!'); const svg = button.querySelector('svg'); svg.style.setProperty('stroke', 'green'); svg.innerHTML = checkSVG; setTimeout(() => { svg.innerHTML = clipboardSVG; svg.style.setProperty('stroke', 'currentColor'); + button.setAttribute('aria-label', 'Copy'); }, 2000); } -- 2.47.3