Page 1 of 1

Copy text

Posted: Thu Dec 13, 2007 3:06 am
by Jim_Bo
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hi,

Any ideas how to het the following to work within firefox with same functionality (text doesnt have to be highlighted)

[syntax="javascript"]<script language="JavaScript">
function ClipBoard()
{
holdtext.innerText = copytxt.innerText;
Copied = holdtext.createTextRange();
Copied.execCommand("Copy");
}
</SCRIPT>

<textarea name="copytxt"><a href="#">Link</a></textarea><button onClick="ClipBoard();">Copy to Clipboard</button><br />
<textarea ID="holdtext" STYLE="display:none;">
</textarea>
Thanks


feyd | Please use[/syntax]

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Thu Dec 13, 2007 10:27 am
by John Cartwright
That feature is disabled by default in Firefox.

Google has a TON to offer on the subject: firefox javascript clipboard