Suppose Stackoverflow wanted to make an easy "Copy link to this question" link. When you clicked this link on What is your best programmer joke?, it would add this HTML to your clipboard:
<a href="https://stackoverflow.com/questions/234075">What is your best programmer joke?</a开发者_StackOverflow>
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?
First off, cross browser copy to clipboard has been a pain for while. Here is a good solution http://zeroclipboard.org/.
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.
精彩评论