<div> <textarea>あいうえお</textarea> <br> <button onclick='this.parentNode.getElementsByTagName("textarea")[0].select(); document.execCommand("copy");' >コピー</button> </div>