QuestionsHow to add a copy to clipboard button
Diogo Santos asked 11 months 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 11 months 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.

Diogo Santos replied 11 months ago

Does it work to add javascript in the aditional css?

Stratos Karavarakis answered 11 months 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

Your Answer
12 + 3 =

Accepted file types: png, jpg, pdf

Add another file