0

In this post we will teach you. (How to Make Button for Textarea Text Copy in Html CSS) .Copy the code below. Then check out our blog through the online HTML editor. Then use the code in your website. If there is a problem with the code, ask your question in the comment box below.

<textarea style ="height :50px;width: 300px;" id="textarea"></textarea> <br> <button id="myDIV" onclick="myFunction(); Copy();">Copy</button> <script> function Copy() { let textarea = document.getElementById("textarea"); textarea.select(); document.execCommand("Copy"); } function myFunction() { var x = document.getElementById("myDIV"); if (x.innerHTML === "Copy") { x.innerHTML = "Copied"; } } </script>

Post a Comment

 
Top