// 클립보드로 내용 복사
// window.navigator.clipboard.writeText( [string] )
window.navigator.clipboard.writeText( 'content what you want' ).then( () => {
console.log( 'copy done' );
} );
// HTML 요소 내용 복사
// HTML document 내용 생략
<body>
<textarea id="myTextArea"/>
</body>
<script>
const myTextArea = document.getElementById( 'myTextArea' );
window.navigator.clipboard.writeText( myTextArea.value ).then( () => {
alert('copy done');
});
</script>
...
https://curryyou.tistory.com/480
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/clipboard