js run html in blob

Solutions on MaxInterview for js run html in blob by the best coders in the world

showing results for - "js run html in blob"
Gabriela
22 Jun 2020
1var val = "<div>abc</div>";
2
3var file = new Blob([val], {
4  type: "text/html"
5});
6// file object reference
7var download = URL.createObjectURL(file);
8
9var a = document.createElement("a");
10a.href = download;
11a.download = "file-" + new Date().getTime();
12document.body.appendChild(a);
13a.click()
queries leading to this page
js run html in blobjs run html in blob