Reputation: 11
I have a website with various links on it. I would like to know if it is possible to code the links in a fashion where once a user clicks on the link, the link text is copied to the user's clipboard while the opening of the link is initiated.
Thanks in advance!
Upvotes: 0
Views: 237
Reputation: 20189
This is possible but only reliable if you use flash which is a big downfall, there are libraries like zero clipboard that are good for this, but other than that its quite a tedious job. This cant be done cross browser with javascript
Upvotes: 0
Reputation: 4052
You can use Zero Clipboard to do the copying and set the onclick handler of the link.
<a onclick="copyMyText(this)" href="url">Text here</a>
Upvotes: 1