...

View Full Version : document.execCommand("Copy") - can it copy a passed variable?



thepip3r
02-16-2007, 09:41 AM
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.

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.

thepip3r
02-21-2007, 11:41 AM
bump.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum