GibboK
GibboK

Reputation: 73908

Script for adding a text in the ClipBoard when a User copy some text from my webpage

I use Asp.net and C# 4, but I suppose for this question I need some JavaScript (maybe jquery).

I have a Web Page, when a User copy some text from the page, I would like that in his Clipboards will be added some custom Text, for example the source URL where he copied the source text from. In this way when he PAST the text he can see the original Text + The custom Text added.

An example of implementation you can find here. Simple Copy and Pase from this page to a Text File and you can see what I need.

http://www.miamiherald.com/2011/10/03/2437413/asian-markets-lower-on-greek-debt.html

Any idea how to do it? Any reference? Thanks for your time on this.

Upvotes: 3

Views: 254

Answers (1)

jmlsteele
jmlsteele

Reputation: 1239

You're looking for the oncopy event. An simple example of it's usage

Another example, adding a copyright warning

Upvotes: 3

Related Questions