Questions tagged [clipboard.js]

Clipboard.js is a modern approach to copy text to clipboard. It doesn't depend on Flash. It has no dependencies. And it's just 2kb gzipped.

Copying text to the clipboard shouldn't be hard. It shouldn't require dozens of steps to configure or hundreds of KBs to load. But most of all, it shouldn't depend on Flash or any bloated framework. That's why clipboard.js exists.

137 questions
0
votes
2 answers

Copy a String to clipboard in Angular 2

I have a method in Angular2 that generates a sharable link which is something like a requestPath. On button click, I need to copy this requestPath to clipboard. How to achieve that? I came across multiple copy-to-clipboard solutions here but nothing…
roger_that
  • 9,493
  • 18
  • 66
  • 102
0
votes
1 answer

Clear data attribute on click

I have a function that copies the data attribute and gives it an active class. I need to be able to clear the active class from .copy-btn when either .close1 or .close2 is clicked. $(document).ready(function() { …
Kyle Underhill
  • 89
  • 15
  • 43
0
votes
0 answers

copy clipboard - clipboard.js - text based on selected icon - not working

Im using Clipboard.js to Copy the coin wallet address based on whichever coin icon is clicked however its not working Spent 3 days on this HEAD
K.Bro
  • 9
  • 2
0
votes
1 answer

clipboard.js modal window 2 inputs

I initiate clipboard.js: new Clipboard('#copy', { container: document.getElementById('.product-modal') }); However I have 2 inputs in the modal window. First one is being selected on load. When I need to copy second one…
miojamo
  • 723
  • 2
  • 14
  • 31
0
votes
2 answers

How do I change the button to say "Copied!" after text is copied to clipboard using clipboard.js?

The following HTML page is from a demo for clipboard.js from clipboardjs.com. I like how this works, where it highlights the text. However, I have a requirement to have it change the button from displaying "Copy" to "Copied!" once the user has…
Edward Coast
  • 374
  • 4
  • 17
0
votes
1 answer

ember-cli-clipboard dynamic clipboardTarget

I’m using the ember-cli-clipboard wrapper to create a set of buttons within an {{#each}}...{{/each}} loop that should copy a small text to the clipboard if you click it. Each element has its own text and its own button. Unfortunately I can not set…
Viktor
  • 41
  • 7
0
votes
1 answer

How to delete Clipboard.js click event

I wanted to remove click event on Element in Clipboard.js. Is there any way to remove click event on button copy icon?
Kamal Kumar
  • 346
  • 2
  • 10
0
votes
1 answer

How to make clipboard.js to copy text to clipboard without pressing any button

As far as I know clipboard.js copies text only when button or link is clicked. Is there other way to copy text?
Maxim
  • 243
  • 3
  • 18
0
votes
1 answer

small alert for copy to clipboard in clipboard.js

I have an Email address in my page and I want when user clicks on it, then the Email address would be copied to the clip board and with small alert(like attached) it shows user in a small label near the box that it copied to clipboard, I used…
neda Derakhshesh
  • 1,103
  • 2
  • 20
  • 43
0
votes
2 answers

Clipboard.js implementation on Dynamicly added elements with jQuery

I am wondering how to use the Clipboard.js functionality when dynamically adding content using jQuery. Currently my code is as follows which works if static on a page loaded without jQuery:
TEXT TO…
0
votes
1 answer

angular 2 - Copy string to clipboard automatically on value changes

I have an angular service which returns a string and I want this string to be in the user's clipboard. I've installed angular2-clipboard to display the result in an input and let the user also click on the "copy" button in case of automatic copy…
dotixx
  • 1,490
  • 12
  • 23
0
votes
1 answer

clipboard.js - paste multiple lines per cell to Excel

I have a problem I'm trying to solve, namely that I'd like to be able to paste the contents of the clipboard (filled using clipboard.js i) to Excel with some cells having two rows. I won't bore you with the ins and outs of my project, but here's a…
DMcCallum83
  • 498
  • 3
  • 13
0
votes
1 answer

White space not removing when using firefox with clipbord js

I am using clipbord.js When I click on my button and copy the code and then paste it some where it leaves quite a large gap at the top I have tried using .replace(/\s/g, "") on here Codepen Example --> Link has been updated with working…
user4419336
0
votes
0 answers

JavaScript - Copy text with clipboard.js based on class name

I'm trying to get a copy-to-clipboard function to work for below HTML-code using the Clipboard.js library:
ratanmalko
  • 449
  • 4
  • 20