JavaScript Reference/Javascript Properties/scope — различия между версиями

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

Текущая версия на 08:21, 26 мая 2010

"scope" Example

    
<html>
<body>
<table>
   <tr>
      <th id="th1">Row 1</th>
      <td>Cell</td>
      <td>Cell</td>
      <td>Cell</td>
      <td id="td1">Cell info 1</td>
      <td>Cell</td>
   </tr>
</table>
<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>



"scope" is applied to

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



"scope" Possible Values

Possible Values
row, 
col, 
rowgroup, 
colgroup.



"scope" Syntax and Note

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