Assuming I have some HTML with untagged content, e.g:
<html>
<body>
<p>text in a tag</p>
other text outside any tag
</body>
</html>
How can I get to the untagged element? Even document.getElementsByTagName(‘*’) does not contain the untagged element.
TIA
Just in your case you can do simply
However in a more general case you need to loop through children and check for
Here is example on jsfiddle