Hi!
I’m trying to copy a Javascript variable to the clipboard. I’m trying to copy a link to the clipboard when clicking on the link. I’m using the execCommand(“copy”), but it won’t work. I’ve only seen examples where it copies a selection into the clipboard.
The link:
<a href="" onclick="javascript:copyImage(This is a small test!!!')">Link</a>
The javascript :
<SCRIPT LANGUAGE="JavaScript">
function copyImage(strFile){
var temp = strFile;
temp.execCommand("Copy");
}
</SCRIPT>
Any suggestions?