1

I am using this to select all content, but how do I copy it to the clipboard at the same time?

<textarea onfocus="this.select();" onmouseup="return false;"  name="tags" cols="50" rows="5"> 

I've tried the following code, but it didn't work out:

copy_sel.clipboard({
    path: 'jquery.clipboard.swf',
    copy: function() {
        var text = $('textarea#tags').val();
        alert('Text copied. Try to paste it now!asdfasdf: '+text);
        return $('textarea#tags').val();
    }
});
Nisse Engström
  • 4,738
  • 23
  • 27
  • 42
alex
  • 4,804
  • 14
  • 51
  • 86
  • do you want to copy to clipboard or to a variable ? – Krishna M Mar 17 '14 at 08:58
  • try this: [copy textarea text to clipboard][1] [1]: http://stackoverflow.com/questions/1539641/how-to-copy-text-to-the-clients-clipboard-using-jquery – M Reza Saberi Mar 17 '14 at 08:59
  • @KrishnaM clipboard (in particular on my Samsung S3, but i guess it will work as if it was in a regular desktop browser) – alex Mar 17 '14 at 09:03

0 Answers0