I am using JSDOM to modify html text using jquery. After I modify it with jquery, i need the full html. I tried the code below, but it wob't give <!Doctype html> and all. How to get the full html?
mycode
import jquery from "jquery";
import { JSDOM } from "jsdom";
function addElement(html){
const { window } = new JSDOM(html);
const $ = jquery(window);
$("body").html("Hello SO!")
return $("html").html()
}
Thanks in advance
May be this will help
` <!DOCTYPE html>
<html lang="en">
<head> ${document.head.getInnerHTML()} </head>
<body> ${document.body.getInnerHTML()} </body>
</html> `