Trouble with ZeroClipboard
- by JorgeV44
Hi, I'm trying to use Zeroclipboard to copy stuff to the clipboard, but it doesn't seem to be working. My code:
HTML:
<textarea name="texter" id="texter"></textarea>
<input type="button" value="Copy to clipboard" id="copy-button" />
Javascript:
<script type="text/javascript">
jQuery(document).ready(function(){
var clip = new ZeroClipboard.Client();
clip.setText('');
jQuery('#copy-button').click(function(){
clip.setText(jQuery('#texter').val());
}
});
</script>
What's wrong with this? Thansk!