2
I’m using this library https://github.com/zeroclipboard to copy text by clicking the user’s Clipboard button. I’m trying to find a way to change its functioning a little, but without success.
The basic usage of the library is:
<html>
<body>
<div id="d_clip_button" class="clip_button" data-clipboard-text="Copy Me!" title="Click to copy." style="border:1px solid black; padding:20px;">Copy To Clipboard</div>
<script type="text/javascript" src="ZeroClipboard.js"></script>
<script type="text/javascript">
var client = new ZeroClipboard( document.getElementById('d_clip_button') );
</script>
</body>
</html>
What I intend to change is when the user clicks on the id="d_clip_button" div he has to return a JQUERY value that is in a variable to inside data-Clipboard-text, in this way I can generate values dynamically from a database, I did several tests, but I could not find the solution, is it possible to do this, or does this library only work with static text? If the answer is YES, I have some way to do what I want?
Perfect, working properly!
– Luis