The createTHead() method of HTMLTableElement objects returns the thead element associated with a given table.
createTHead()
MDN Reference