开发者

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

开发者 https://www.devze.com 2023-02-12 15:26 出处:网络
I found some nice solutions here on how to copy text in JavaScript to the clipboard in: How do I开发者_Go百科 copy to the clipboard in JavaScript?

I found some nice solutions here on how to copy text in JavaScript to the clipboard in: How do I开发者_Go百科 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号