3 ms·
Aren't there lots of scripts that depend on the head, body, and even html tags? The HTML tag in particular is used for a lot of feature detection, and the body
by ravenstine 7y ago
Aren't there lots of scripts that depend on the head, body, and even html tags? The HTML tag in particular is used for a lot of feature detection, and the body is used as the root element for a lot of SPAs.
That's not to say that abolishing those tags isn't a great idea, but it would be harder than it looks for projects with an appreciable number of dependencies. I'm definitely in support of never writing that stupid <html> tag again.
- alexhutcheson 7y agoI think those elements still end up in the DOM regardless of whether you type them out explicitly. I might be mid-remembering though.
- ravenstine 7y agoAh yes, you're right. I forget a lot of those browser behaviors that haven't much consequence on my work.
- butz 7y agoYou are correct. Browser fills in missing tags, closes elements, etc. Try opening blank page in any browser and inspect it: you'll find html, head and body tags already placed in DOM.
- edflsafoiewq 7y agoThere's a difference between a tag, which is a bit of concrete syntax like "<b>" or "</html>", and an element, which is basically a node in the DOM.