Answers for "js run html in blob"

0

js run html in blob

var val = "<div>abc</div>";

var file = new Blob([val], {
  type: "text/html"
});
// file object reference
var download = URL.createObjectURL(file);

var a = document.createElement("a");
a.href = download;
a.download = "file-" + new Date().getTime();
document.body.appendChild(a);
a.click()
Posted by: Guest on February-16-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language