0
 <input type="text" class="formcontrol" value="{{
 referral_link }}">

 <a href="#" class="copybutton">Copy link to clipboard</a>

So there is an input field which generates tracking link ( {{referral_link }} ) for logged in users. Next to it there is a button which should copy that link to clipboard when clicked on.

Is there an easy HTML5 solution for this or what is the current most modern way to do this ?

pzin
  • 4,200
  • 2
  • 28
  • 49
user3187469
  • 1,461
  • 7
  • 23
  • 31

1 Answers1

1

There is no HTML5 solution for this. Older versions of IE supported copying text to the clipboard via javascript, but that is no longer supported. You'll need to use something like ZeroClipboard to accomplish what you want to do.

K. S.
  • 586
  • 5
  • 20