0

I want to select all and copy to clipboard the value of input when the user clicks on the input itself with cross browser support.

Example:

onClick this:

<input value="Generated Value: www.google.com" />

it will SelectAll and copy the Generated Value: www.google.com to the clipboard

I have tried a few jquery ready made scripts but i can't get them to work this way as they only work if the user clicks on a button or href link.

Jeremy John
  • 1,665
  • 3
  • 18
  • 31

1 Answers1

1

Check the javascript library ZeroClipboard at davidwalsh.name/clipboard

I hope it will help you :-)

air4x
  • 5,618
  • 1
  • 23
  • 36
xdeepakv
  • 7,835
  • 2
  • 22
  • 32