js parse string to html elemen code example
Example: js parse string to html elemen
htmlString = "<body><p>Hello World</p></body>"
var parser = new DOMParser();
var doc = parser.parseFromString(htmlString, "text/html")
doc.body
htmlString = "<body><p>Hello World</p></body>"
var parser = new DOMParser();
var doc = parser.parseFromString(htmlString, "text/html")
doc.body