Skip to content

Commit

Permalink
fix btn copied text
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianogtl committed Jun 12, 2024
1 parent e43fcf0 commit 47e5504
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ <h2>Reference</h2>
</main>
<footer>
<span>
JS icons by
JS icon by
<a
href="https://icons8.com/"
target="_blank"
Expand Down
7 changes: 4 additions & 3 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ function addClipboardBtns() {
function addClipboardEvent(clipboardBtn, preTagContent) {
clipboardBtn.onclick = () => {
navigator.clipboard.writeText(preTagContent);
setInterval(() => {
clipboardBtn.innerText = "Copied!";
set;
clipboardBtn.innerText = "Copied!";
setTimeout(() => {
clipboardBtn.innerText = "Copy";
}, 3000);
clipboardBtn.innerText = "Copy";
};
}

Expand Down

0 comments on commit 47e5504

Please sign in to comment.