Element: ariaColSpan プロパティ
        
        
          
                Baseline
                
                  2023
                
                
              
        
        Newly available
        
          
                
              
                
              
                
              
        
        
      
      Since October 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
ariaColSpan は Element インターフェイスのプロパティで、aria-colspan 属性の値を反映し、表、グリッド、ツリーグリッドの中にあるセル、グリッドセルがまたがる列の数を定義します。
値
整数の入った文字列です。
例
この例では、spanning-heading という ID を持つ要素の aria-colspan 属性は "2" に設定されています。ariaColSpan を使用して、値を "3" に更新します。
html
<table>
  <tr>
    <th>Heading 1</th>
    <th>Heading 2</th>
    <th>Heading 3</td>
  </tr>
  <tr>
    <td colspan="2" aria-colspan="2" id="spanning-column">Spanning</td>
    <td>One</td>
  </tr>
</table>
js
let el = document.getElementById("spanning-column");
console.log(el.ariaColSpan);
el.ariaColSpan = "3";
console.log(el.ariaColSpan);
仕様書
| Specification | 
|---|
| Accessible Rich Internet Applications (WAI-ARIA)> # dom-ariamixin-ariacolspan> | 
ブラウザーの互換性
Loading…