daily pastebin goal
0%
SHARE
TWEET

COPY TO CLIPBOARD

a guest Mar 25th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <input type="text" value="TEXT" id="myInput">
  6. <button onclick="myFunction()">Copy text</button>
  7.  
  8. <script>
  9. function myFunction() {
  10.   var copyText = document.getElementById("myInput");
  11.   copyText.select();
  12.   document.execCommand("copy");
  13.   alert("Copied the text: " + copyText.value);
  14. }
  15. </script>
  16.  
  17. </body>
  18. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top