Skip navigation

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: