Copy to Clipboard
Easily Copy Text, Links, or Emails with a Button Click Using `vdx-copy-button` and `vdx-copy-this` Attributes. Zero code 100% Javacript solutions
Add Slider Attribute
Firstly, make sure you have the VisualDX script before your </body>. Checkout the Quick Start for how to do this.
Add Copy Attribute to Button
Copy this attribute:
Paste vdx-copy-button into the Custom Attribute Name of the Button you wish to use as the trigger for the copy action and give it a unique Value. eg. copy-text
Add Copy This Attribute to Text Block
Copy this attribute:
Paste vdx-copy-this into the Custom Attribute Name of the Text Block element you wish to copy and give it the same unique Value as the Button eg. copy-text
Add Copy Alert Attribute to Text Block
Copy this attribute:
Paste vdx-copy-alert into the Custom Attribute Name of the Text Block element you wish to copy and give it the same unique Value as the Button eg. copy-text
If there are multiple instances on the same page, simply give each attribute the same value
For example:
- vdx-copy-button = "title" and vdx-copy-this = "title" and vdx-copy-alert = "title"
- vdx-copy-button = "subtitle" and vdx-copy-this = "subtitle" and vdx-copy-alert = "subtitle"
- vdx-copy-button = "webflow-blue" and vdx-copy-this = "webflow-blue" and vdx-copy-alert = "webflow-blue"