This post is a part 11 of Intel XDK Complete Tutorial post series.
Text can be programmatically copied into clipboard by just one line of code
intel.xdk.device.copyToClipboard("This is the text in clipboard");
This function only works inside event handlers. So you can’t just call it whenever you like to. For example:
document.addEventListener("intel.xdk.device.ready",function(){
intel.xdk.device.copyToClipboard("This is the text in clipboard");
},false);
intel.xdk.device.copyToClipboard("This is the text in clipboard");
},false);
Make sure you have also added Intel XDK Device plugin in your app.