JSFiddle - React, Tailwind, and code Playground
by lborgman
JavaScript
const u = new URL("mailto:[email protected]");
u.searchParams.append("subject", "Hi everyone!");
const href = u.toString();
const eltA = document.createElement("a");
eltA.textContent = "Send mail";
eltA.setAttribute("href", href);
document.body.appendChild(eltA)