HTML
<textarea name="" id="txt" >吼吼吼</textarea>
<input type="button" onclick="fu()" value="点击复制"></input>
JavaScript
<script>
let txt = document.getElementById('txt');
function fu(){
txt.select();
document.execCommand('copy');
alert("内容复制成功!!!");
}
</script>