by btilly · 2y ago · 0 comments
<b>Hello <i>World!</b> Greetings</i> Earthlings!It might work because the HTML5 parsing algorithm produces well-defined results for broken HTML, but I'm not sure that's the same as "perfectly valid" – the spec calls such markup "misnested" and "erroneous" [0].
[0] https://html.spec.whatwg.org/#an-introduction-to-error-handl...
<b>Hello <i>World!</></b><i> Greetings</i> Earthlings!
You can see this by looking at the innerHTML, which is really just a serialized form of the DOM tree.