17 lines
502 B
JavaScript
17 lines
502 B
JavaScript
|
|
document.getElementById('joinurl').addEventListener('click',(e) => {
|
|
var url = document.getElementById('joinurl');
|
|
var sel = window.getSelection();
|
|
var range = document.createRange();
|
|
range.selectNodeContents(url);
|
|
sel.removeAllRanges();
|
|
sel.addRange(range);
|
|
if (document.execCommand('copy') === true) {
|
|
url.classList.add('copied');
|
|
setTimeout(() => {
|
|
url.classList.remove('copied');
|
|
}, 0);
|
|
|
|
}
|
|
sel.removeAllRanges();
|
|
});
|