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

02-16-2007, 08: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)

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.

02-21-2007, 10:41 AM

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum