As you know, to get the body element of an HTML document in the JS language, you can simply write

 var body = document.body; 

However, looking at the W3C DOM level 3 specification, I did not find where it says about this feature. Therefore, I would like to receive a link to the regulatory document, which describes the admissibility of such a construction.

  • For a later spec, the link will suit? (Actually, this is described in a slightly different specie, as I understand it, here)
  • @ Duck LEARNING Yes, it is only important for me that this be reflected in any regulatory document. - Vlad from Moscow
  • Well, actually I threw the link, it's in the html specs and not in the dom - Duck Learns to Hide
  • @ Duck LEARNING THE SAME The same thing happens on the W3C? - Vlad from Moscow

1 answer 1

This is written in the HTML specification, not in the DOM, for the current spec in section 3.1.3 of DOM Tree accessors.

For example here (living standard): https://html.spec.whatwg.org/multipage/dom.html#dom-document-body

Or here (spec for 10/28/2014): https://www.w3.org/TR/html5/dom.html#dom-tree-accessors