Copy and paste the selected text to the clipboard using JavaScript
问题 I'm building a custom right-click menu for my system and I need to know how can I make a JavaScript function to copy the selected text, basically 100% like the original right-click menu does. I'm aware of the Flash work-arounds. I want to do this in JavaScript. Every answer I've seen so far is only a half-answer because none of them explains how to make a copy button for the selected text - all what they do is copy a pre-defined text or a text from a textbox. 回答1: Modern Day Browsers block