DEV Community

Discussion on: Are you 'using' "useless" "\"QUOTES\""?

Collapse
 
gottz profile image
Jan-Stefan Janetzky

well.. while i agree mostly.. <head> and <body> should be present tho.

at least <head>, due to the fact the document object model differs between head and body when it comes to DOM selectors and search engines.

Collapse
 
rsp profile image
Rafał Pocztarski

I agree and in fact I always use explicit <head> and <body> exactly for that reason. Here I removed them to demonstrate that it is indeed not required by the standard. <head> is actually mandatory so <html></html> is invalid because it has no <head> but <title> gets <head> automatically so interestingly it is valid here. I don't like automatic wrapping so I add explicit <head> and <body> because in addition to what you pointed out it is also not obvious if a given <script> is in the head or body so the structure is not obvious. But I argue for not cluttering the code with redundant type="application/ecmascript" attributes etc.

Collapse
 
gottz profile image
Jan-Stefan Janetzky

fun fact, i use <script type=module async> these days.