Advertisement
Guest User

Crypto.ba Copy Address

a guest
May 2nd, 2021
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.61 KB | None | 0 0
  1. <?php
  2. $addresses = ["123456", "654321", "3bacdef1"];
  3. echo("test");
  4. echo("<table>");
  5. foreach ($addresses as $x) {
  6.     echo("<tr><td>" . $x . "</td><td><button onclick=\"copyToClipboard('".$x."')\">Copy</button></td></tr>");
  7. };
  8. echo("</table>");
  9.  
  10. echo("<input type=\"text\" value=\"\" id=\"myInput\">");
  11. ?>
  12.  
  13. <script>
  14.  
  15. function copyToClipboard(element) {
  16.     let text = document.createElement('input');
  17.     text.setAttribute('type', 'text');
  18.     text.value = element;
  19.     document.body.appendChild(text);
  20.     text.select();
  21.     document.execCommand('copy');
  22.     document.body.removeChild(text);
  23. }
  24. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement