I'm trying to allow for a save feature on my webpage. I'm using the 'SaveFile.js' module found here: 'https://github.com/eligrey/FileSaver.js/' When a user clicks the save button, the document should download itself as an HTML file with all of its elements like input boxes, pictures etc. However, what gets downloaded isn't the full HTML document. Just some text on an HTML page:
Why is this happening?
<button type="button" name="btnSave" onclick="saveHTMLFile()">Save</button>
<script>
function saveHTMLFile(){
let fileToSave=document;
let blob = new Blob([fileToSave],{type:"text/html;charset=utf-8"});
saveAs(blob,'SavedOutline.html')
}
</script>