diff options
Diffstat (limited to 'youtube/static')
-rw-r--r-- | youtube/static/js/common.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/youtube/static/js/common.js b/youtube/static/js/common.js index 79f8834..599d578 100644 --- a/youtube/static/js/common.js +++ b/youtube/static/js/common.js @@ -94,7 +94,8 @@ function copyTextToClipboard(text) { textArea.value = text; - document.body.appendChild(textArea); + let parent_el = video.parentElement; + parent_el.appendChild(textArea); textArea.focus(); textArea.select(); @@ -106,7 +107,7 @@ function copyTextToClipboard(text) { console.log('Oops, unable to copy'); } - document.body.removeChild(textArea); + parent_el.removeChild(textArea); } |