diff options
Diffstat (limited to 'assets/helpers.js')
-rw-r--r-- | assets/helpers.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/assets/helpers.js b/assets/helpers.js new file mode 100644 index 0000000..9d6749c --- /dev/null +++ b/assets/helpers.js @@ -0,0 +1,14 @@ +function copyText() { + // Get the text field + var roomLink = document.getElementById("roomlink"); + + // Select the text field + roomLink.select(); + roomLink.setSelectionRange(0, 99999); // For mobile devices + + // Copy the text inside the text field + navigator.clipboard.writeText(roomLink.value); + + // Alert the copied text + alert("Copied the text: " + roomLink.value); +} |