Copy Text Variable to Clipboard

Feb 09, 2015

I need some help. 

I need users to be able to click a button to copy a text variable to their clipboard, which can then be pasted in a word doc. This doesn't necessarily have to be done through a text variable, but is the only way I've come to think this will work.

In the past I used a text entry field that when published allows users to copy and paste the text by highlighting and right clicking as you normally would. I've been asked to eliminate that route and only use a one-click copy to clipboard button.

I was able to get this to work using JavaScript, however, this only worked in IE and I desperately need it to work in FireFox. I used the method below from another post to get it to work in IE:

Copy to Clipboard JS

I've sifted through post after post and haven't found anything that will work for this situation. If at all possible, this would be great if this worked with HTML5 as well.

Any help would be greatly appreciated. Thanks!

26 Replies
martin yeaman

Thanks Becca, I'm after code that copies the users input into the clipboard. 

I have created a simple scene with just a Data Input Text Box and a button in Storyline. The object trigger is the button which executes JS to copy their text input into clipboard.

"Button 1

Execute Javascript

 When the user clicks button 1"

This is published to Review 360 and hosted in a Rise course.