Why do browsers still inject <tbody> in HTML5?
12:30 20 Sep 2011

HTML5 doctype example.

Both IE9 and Chrome14 log TBODY as the tagName of the element inside the

The HTML5 spec on

clearly states :

followed by either zero or more tbody elements or one or more tr elements

Furthermore. The HTML5 spec on

clearly states :

As a child of a table element, after any caption, colgroup, and thead elements, but only if there are no tbody elements that are children of the table element.

Why are browsers corrupting my DOM and injecting a

when

  • I did not ask for one
  • It's perfectly valid without one

The answer of "backwards compatiblity" makes absolutely zero sense because I specifically opted in for a HTML5 doctype.

html