JavaScript Reference/Javascript Properties/tHead

Материал из Web эксперт
Перейти к: навигация, поиск

"tHead" Example

   <source lang="javascript">
   

<html> <body> <script language="JavaScript"> function function1() {

   document.all.myTable.tHead.style.backgroundColor = "blue";

} </script>

<thead> </thead> <tbody> </tbody> <tfoot> </tfoot>
tHead, Cell 1
tBody, Cell 2
tBody, Cell 3
tBody, Cell 4
tFoot, Cell 5

<button onclick="function1();">Turn Head Blue</button> </body> </html>


     </source>
   
  


"tHead" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+

| Applied_To | | +----------------+--------------------------------------------------------------+ </source>

"tHead" Syntax and Note

   <source lang="javascript">

Note: Read and write property. Sets a reference to a <thead> element.

Syntax:

document.getElementById("tableID").tHead = value document.all.tableID.tHead = value // IE only


</source>