JavaScript Reference/Javascript Properties/scope

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

"scope" Example

   <source lang="javascript">
   

<html> <body>

Row 1 Cell Cell Cell Cell info 1 Cell

<script language="JavaScript">

   document.all.th1.scope = "colgroup";

</script> <button onclick="alert("This cell provides header information for its col.");"> Cell info 1 </button> </body> </html>


     </source>
   
  


"scope" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | Applied_To |<td> <th> | +----------------+--------------------------------------------------------------+

     </source>
   
  


"scope" Possible Values

   <source lang="javascript">

Possible Values row, col, rowgroup, colgroup.


     </source>
   
  


"scope" Syntax and Note

   <source lang="javascript">

Note: Read and write property. Sets a cell to be a header cell.

Syntax:

document.getElementById("elementID").scope = value document.all.elementID.scope = value // IE only


     </source>