# Copying a content with copy icon

**URL:** <https://meta.discourse.org/t/copying-a-content-with-copy-icon/287007>\
**Category:** Development\
**Created:** [November 29, 2023, 8:59pm UTC](https://meta.discourse.org/t/copying-a-content-with-copy-icon/287007 "2023-11-29T20:59:35Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![bekircem](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bekircem/32/44582_2.png) [@bekircem](https://meta.discourse.org/u/bekircem)\
**Post date:** [November 29, 2023, 8:59pm UTC](https://meta.discourse.org/t/copying-a-content-with-copy-icon/287007/1 "2023-11-29T20:59:35Z")

</div>

Hi, instead of printing a piece of data provided to me by the plugin through a form, I want to enable users to copy this content when they wish by clicking on a ‘copy’ icon.

I noticed that Discourse has introduced this feature for code blocks, but it only works within these blocks. How can I use it elsewhere as I desire?

> [@Copy codeblock contents to clipboard](https://meta.discourse.org/t/copy-codeblock-contents-to-clipboard/148855):
>
> mega Now live in core Discourse is the ability to show a copy button for codeblocks! import { createWidget } from 'discourse/widgets/widget'; createWidget('my-widget', { tagName: 'div.hello', html() { return "hello world"; } }); This feature is off by default, but if your community could benefit from it, you can turn it on by enabling the show copy button on codeblocks site setting. Some notes about the feature: The button shows up on pre \> code codeblocks, but not inline, …

Thanks,

---

_[View the full topic](https://meta.discourse.org/t/copying-a-content-with-copy-icon/287007)._
