參考內容推薦

Clipboard API - return value as html format

2 To read any HTML in the clipboard, you can use the navigator.clipboard.read method, find the ClipboardItem within the resulting array that offers HTML (if there is one), and then read that HTML from the item, like this:

clipboardtohtmlconverter

2ToreadanyHTMLintheclipboard,youcanusethenavigator.clipboard.readmethod,findtheClipboardItemwithintheresultingarraythatoffersHTML(ifthereisone),andthenreadthatHTMLfromtheitem,likethis: