views:

42

answers:

1

Suppose Stackoverflow wanted to make an easy "Copy link to this question" link. When you clicked this link on http://stackoverflow.com/questions/234075/what-is-your-best-programmer-joke, it would add this HTML to your clipboard:

<a href="http://stackoverflow.com/questions/234075"&gt;What is your best programmer joke?</a>

So when you pasted into Gmail or whatever, it would look like this: What is your best programmer joke?

What's the best way to accomplish this in a cross-browser fashion?

+6  A: 

First off, cross browser copy to clipboard has been a pain for while. Here is a good solution http://code.google.com/p/zeroclipboard/.

Note, that you are trying to copy HTML or rich text so pasting into notepad for instance will give you the full HTML. It should work as you want if you paste into rich text editor.

Dustin Laine