Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Quoting:

---------

Thus, going back to the snippet:

    <form id="outer"><div></form><form id="inner"><input>
In the beginning, the form element pointer is set to the one with id="outer". Then, a div is being started, and the </form> end tag set the form element pointer to null. Because it’s null, the next form with id="inner" can be created; and because we’re currently within div, we effectively have a form nested in form.

---------

I was under the impression that a closing tag automatically also closed any tags that were currently open, but contained within the tag being closed. Is it not a bug that, when the </form> tag is encountered, the open <div> tag isn't closed at that point?



Under HTML and the DOM (no Javascript) You can do any ordering of the tags, that's pretty normal a <strong><div>hello</strong></div> is perfectly valid HTML


That’s not valid HTML. It’s “working” HTML, because error recovery is defined pretty well, but quite invalid.


No, you're specifically not allowed to do that.


You misspelled “specificationally”. :-D




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: