Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //copy to clipboard
- $(document).on('click', '[data-action=copy]', function (){
- /* Create input */
- $('[data-action=copy]').after('<input class="hide" value="'+$(this).attr("data-url")+'" id="share-url">');
- /* Get the text field */
- var copyText = document.getElementById("share-url");
- /* Select the text field */
- copyText.select();
- /* Copy the text inside the text field */
- document.execCommand("copy");
- /* Alert the copied text */
- alert("copied");
- });
- <a data-action="copy" data-url="{{$whatext.'s=link'}}" href="#">
- <img src="{{ cdn('/img/social/link.png') }}" >
- </a>
Add Comment
Please, Sign In to add comment