How to add a copy to clipboard button

Share on facebook
Share on twitter
Share on reddit
Share on linkedin
Share on pinterest
Share on email
QuestionsHow to add a copy to clipboard button
D
Diogo Santos
asked 2 years ago

Hi everyone!

If anyone could help me it would be awesome! I need to have a button in my website that when clicked, automatically copies text. I'm using elementor pro to build my website. There is only one plugin that says that can do that but I think that it's not possible to use that in elementor.

Does anyone knows what css code can I write in the Custom css of the button that automatic copies text?

Thank you so much for your time and help!

D.S.

2 Answers
Adam @ WPCrafter Staff answered 2 years ago

I wish I was able to provide some direction, but the best I can do is say that there just be some javascript out there, or a tutorial related to javascript to make this easier to do.

Maybe someone else that visits this page may have more specific help.

D
Diogo Santos
replied 2 years ago

Does it work to add javascript in the aditional css?

Stratos Karavarakis answered 2 years ago

This plugin can do what you want with the use of a shortcode so you can use it with elementor.

Copy To Clipboard – mobile + web

This plugin can also do this by using code witch can work with elementor too.

CLIPBOARD

This website gives you a method by using JavaScript instead of a WordPress plugin.

http://javascript-html5-tutorial.com/copy-to-clipboard-in-javascript-jquery-zclip.html

 

So I would suggest to use one of those solution and customize it as you want using CSS than start from scratch with php to create your own button