I'm currently implementing a save feature for my website. Utilizing the 'SaveFile.js' module from this link: 'https://github.com/eligrey/FileSaver.js/' Once the user clicks on the save button, the goal is to have the entire document download as an HTML file with all its elements intact like input boxes, images, and so on. However, instead of the full HTML document, only some text from an HTML page seems to be downloaded:
https://i.stack.imgur.com/Zd9sX.png
What could be causing this issue?
<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>