I am trying to pull content inside a variable using plain java script. I am trying to get only part of the variable with an id. In this example I am trying to pull only part of html with id ‘container’.
My fiddle https://jsfiddle.net/a2ngc9jv/2/
var htmlPage = `
<html>
<div>
testing but not required
</div>
<div id="container">
<p>
i want to pull this whole block from parent
</p>
<p>
test 2
</p>
</div>
</html>`;
console.log(htmlPage.getElementById("container"))
console.log(document.getElementById("container"))