htmlString = "<body><p>Hello World</p></body>" var parser = new DOMParser(); var doc = parser.parseFromString(htmlString, "text/html") doc.body