15 lines
381 B
JavaScript
15 lines
381 B
JavaScript
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);
|
|
}
|