# How can I add a Copy Button?

**URL:** <https://community.thunkable.com/t/how-can-i-add-a-copy-button/1040333>\
**Category:** Questions about Thunkable X\
**Tags:** beginner\
**Created:** [December 19, 2020, 12:04pm UTC](https://community.thunkable.com/t/how-can-i-add-a-copy-button/1040333 "2020-12-19T12:04:19Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [December 20, 2020, 6:01pm UTC](https://community.thunkable.com/t/how-can-i-add-a-copy-button/1040333/10 "2020-12-20T18:01:15Z")

</div>

I’m wondering if a JavaScript solution would work with the webviewer.

```auto

<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="https://thunkable.github.io/webviewer-extension/thunkableWebviewerExtension.js" type="text/javascript"></script>
  </head>
  <body>
  <script type="text/javascript">
 function copyToClipboard(value) {
  var tempInput = document.createElement("textarea");
  tempInput.value = value;
  document.body.appendChild(tempInput);
  tempInput.select();
  document.execCommand("copy");
  document.body.removeChild(tempInput);
} 

ThunkableWebviewerExtension.receiveMessage(function(message) {
copyToClipboard(message)
});
  </script>
</html>

```

[https://x.thunkable.com/copy/00c79b0c245b1c0101476aceac42981e](https://x.thunkable.com/copy/00c79b0c245b1c0101476aceac42981e)

this does in fact work!

the only blocks needed

 ![Screen Shot 2020-12-20 at 2.12.30 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/d/2d5e3871ae6c72463a0bd0f22e3dbd05418b3f78.png)

@darren this would be a cool addition to sendth.at perhaps?!

---

_[View the full topic](https://community.thunkable.com/t/how-can-i-add-a-copy-button/1040333)._
