You are here: Reference > JavaScript > client-side > HTML DOM > properties > tHead (table)

tHead property (table)

Browser support:
Returns a reference to the thead element of the table.
The thead element is used to create a header for tables.

Syntax:

object.tHead;
You can find the related objects in the Supported by objects section below.
This property is read-only.

Possible values:

Returns the thead element that belongs to the table or null if it is not defined.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the tHead property:
<head>
    <script type="text/javascript">
        function GetTHead () {
            var tableHead = document.getElementById ("myTable").tHead;
            alert (tableHead.innerHTML);
        }
    </script>
</head>
<body>
    <button onclick="GetTHead ();">Get the innerHTML of the THead!</button>
    <table id="myTable" border="1px">
        <thead>
            <tr>
                <td>The contents of the THead element</td>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>First row.</td>
            </tr>
        </tbody>
    </table>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content