Abe Estrada

TIL: How to copy html in JavaScript

await navigator.clipboard.write([
  new ClipboardItem({
    ["text/plain"]: new Blob([element.innerText], { type: "text/plain" }),
    ["text/html"]: new Blob([element.innerHTML], { type: "text/html" }),
  }),
]);