JSFiddle - React, Tailwind, and code Playground

by Ismail RBOUH

HTML

<script src="https://rawcdn.githack.com/eligrey/FileSaver.js/master/FileSaver.js"></script>
<div>

</div>

<button id="save">Save</button>
<button id="add">Add Elements</button>

JavaScript

$("#add").click(function() {
    $("<div>").text(Math.random()).appendTo("body");
});

$("#save").click(function() {
    var blob = new Blob([$("html").html()], {
        type: "text/html;charset=utf-8"
    });
    saveAs(blob, "page.html");

});