1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22

content / test / data / accessibility / event / aria-posinset-changed.html [blame]

<!DOCTYPE html>
<html>
<body>
<ul role="listbox">
  <li id="li1" role="option">Li1</li>
  <li id="li2" role="option" aria-posinset="2">Li2</li>
  <li id="li3" role="option" aria-posinset="3">Li3</li>
</ul>
<script>
  function go() {
    // Set aria-posinset from default calculation '1'->'2'; should fire an event.
    document.getElementById('li1').setAttribute('aria-posinset', '2');

    // Set aria-posinset from '2'->[removed]; should fire an event.
    document.getElementById('li2').removeAttribute('aria-posinset');

    // Set aria-posinset from '3'->'3; should not fire an event.
    document.getElementById('li3').setAttribute('aria-posinset', '3');
  }
</script>
</body>
</html>