I've tried a bunch of different variants but all of the posts on the web are for copying information from HTML forms. I want to copy something to the clipboard that I pass off of a hyperlink.
Code:
function copyToClipboard(x) {
if (x)
{
alert(x);
x.document.execCommand("Copy");
}
}
Very rudimentary I know but when I click my hyperlink, "x" alerts fine. the message box holds the data i want it to. Now I just need help getting it copied to the clipboard. Is there any way I can just pass my varaible "x" to document.execCommand("Copy") ? If so, please elaborate.