works in ie only:
<html> <head> <script type="text/javascript"> function copy_to_clipboard(field) { var val = document.getElementById( field ); val.select(); if (document.all) { range = val.createTextRange(); range.execCommand("Copy"); alert('Quote successfully copied. Press Ctrl + V to paste'); } } </script> </head> <body> <p> Type text and copy it. <input id="textfield" type="text" value="testdata" /> <input type="button" onclick=" copy_to_clipboard( 'textfield' ); " value="click" /> </p> </body> </html>
got idea from
http://www.quotedb.com/quotes/2308
more:
http://www.jeffothy.com/weblog/clipboard-copy/
Advertisements