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

content / test / data / accessibility / html / a-onclick.html [blame]

<!--
@BLINK-ALLOW:defaultActionVerb*
@BLINK-ALLOW:linked
@WIN-ALLOW:action_name*
@WIN-ALLOW:default_action*
@WIN-ALLOW:LINKED
@WAIT-FOR:Done
-->
<html>
<style>a { text-decoration: underline; display: block; }</style>
<body>
  <div tabindex="0" id="status" aria-label="Working"></div>
  <a onclick="javascript:alert('1');">link with no href but onclick</a>
  <a id="add-click-handler-to-me">link with no href and click handler added via script</a>
  <a>Link with no event handler</a>
  <script>
    setTimeout(() => {
      document.getElementById('add-click-handler-to-me').
        addEventListener('click', function() { alert('2'); }, false);
        document.getElementById('status').setAttribute('aria-label', 'Done');
    }, 1000);
  </script>
</body>
</html>