From ff138c18a950b91e8354026bf8933e6c1047ceae Mon Sep 17 00:00:00 2001 From: home Date: Thu, 25 Jun 2020 10:47:22 +0200 Subject: [PATCH] option mehrere copier sachen auf einer seite zu haben --- README.md | 2 +- copy-to-clipboard.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ceb677f..0e63dd9 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ git submodule add https://git.seemsleg.it/ef/cssjs-func-lib cssjs
- + Kopieren
``` \ No newline at end of file diff --git a/copy-to-clipboard.js b/copy-to-clipboard.js index c7f80c6..ee6c105 100644 --- a/copy-to-clipboard.js +++ b/copy-to-clipboard.js @@ -1,5 +1,5 @@ -function copyToClipboard() { - var copyText = document.getElementById("copy-to-clipboard"); +function copyToClipboard(id) { + var copyText = document.getElementById(id); /* Select the text field */ copyText.select(); @@ -9,12 +9,12 @@ function copyToClipboard() { document.execCommand("copy"); } -function copiedToClipboard() { - var tooltip = document.getElementById("copy-to-clipboard-tooltip"); +function copiedToClipboard(id) { + var tooltip = document.getElementById(id); tooltip.innerHTML = "Kopiert"; } -function resetClipboard() { - var tooltip = document.getElementById("copy-to-clipboard-tooltip"); +function resetClipboard(id) { + var tooltip = document.getElementById(id); tooltip.innerHTML = "Kopieren"; } \ No newline at end of file