Copy HTML to the clipboard
Did you know that you can copy HTML to the clipboard using the write
method? This can be useful if you need to copy formatted text or images.
const type = 'text/html';
const blob = new Blob([signature], { type });
const data = [new ClipboardItem({ [type]: blob })];
await navigator.clipboard.write(data);