Forum Discussion
BrettSchlagel-e
10 years agoCommunity Member
Copy Text Variable to Clipboard
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 ...
ignaciovazquez
9 years agoCommunity Member
Hi I’m trying to use a button to copy a variable directly to the clip board and I have not had much success.
“copytext” is the variable I am using as an input in articulate.
This is the java script I added to the articulate button:
var player = GetPlayer();
var vtext= player.GetVar("copytext");
holdtext.innerText=vtext;
Copied=holdtext.createTextRange();
Copied.execCommand("Copy");
And I added this to the story.html file:
<textarea id="holdtext" style="display: none;"></textarea>
any thoughts on how I can fix this?