Clipboard Copy | JavaScriptSource

Clipboard Copy

Mark O'Sullivan Jul 11, 2007


There are many scripts for copying text from a Web page that work fine in MS Internet Explorer but not in Firefox, Netscape, or Opera. This cross-browser script, however, will do the trick. It will copy a designated portion of text into the Windows clipboard, using a small Macromedia Flash file to perform the copy on the browser's behalf.


Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: clipboardCopy.js


Paste this code into the HEAD section of your HTML document.


Paste this code into the BODY section of your HTML document


Download the images using the URL below:

Leave a Response


Sounds like you have JavaScript turned off in your browser.

Lee Jan 16, 2009

The Clipboard Copy sample as provided on this page doesn't work for me in firefox but it works for one of my coworkers using the same version of firefox. Any ideas why it's not working for me?[br /][br /]Thanks,[br /]Bruce

Bruce Dec 9, 2008

Thanks for posting this information. I was about to give up the copy to clipboard and show the url in small popup.[br /][br /]Then I came across your article[br /][br /]Thanks for your help

jagdish Jul 28, 2008

In order to better help you, you'll need to post your question [a href=""]over on the forums[/a].

Lee Jun 26, 2008

Hello,[br /][br /]In my case code is not working...[br /]It giving me error window is not define.[br /][br /]help me out![br /][br /]Thanks[br /]Paresh

Paresh Jun 5, 2008