简体   繁体   中英

How to Copy to Clipboard in JavaScript and make it HTML?

I found some nice solutions here on how to copy text in JavaScript to the clipboard in: How do I copy to the clipboard in JavaScript?

But is there any way to give it a type? Want I want is to paste to clipboard something like:

this is < b >bold< /b >

and when pasting it into OpenOffice or Word, get

this is bold

You could just manipulate the string the user selects before sending it to the clipboard. Refer the answer for this question which shows how a string manipulation could be done before copying it to the clipboard .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM