回答編集履歴
1
ちょうせい
answer
CHANGED
|
@@ -5,11 +5,10 @@
|
|
|
5
5
|
document.querySelector('#copy').addEventListener('click',()=>{
|
|
6
6
|
const ta = Object.assign(document.createElement('textarea'),{
|
|
7
7
|
textContent:content,
|
|
8
|
-
id:'ta',
|
|
9
8
|
style:'positon:absolute;top:-999px',
|
|
10
9
|
});
|
|
11
10
|
document.querySelector('body').appendChild(ta);
|
|
12
|
-
|
|
11
|
+
ta.select();
|
|
13
12
|
document.execCommand('copy');
|
|
14
13
|
document.querySelector('body').removeChild(ta);
|
|
15
14
|
});
|