Difference between revisions of "Event Watcher"

From Level Access Web Labs
Jump to navigation Jump to search
m
 
(18 intermediate revisions by 2 users not shown)
Line 10: Line 10:
 
       content: "Our ";
 
       content: "Our ";
 
     }
 
     }
     #d2 {
+
     #log1 {
 
         height:15em;
 
         height:15em;
 
         overflow:scroll;
 
         overflow:scroll;
Line 21: Line 21:
 
       function test(e) {
 
       function test(e) {
 
           var evt = e ? e : window.event;
 
           var evt = e ? e : window.event;
 +
          var c = e.keyCode ? e.keyCode : "";
 
           var d = document.createElement("div");
 
           var d = document.createElement("div");
           var t = document.createTextNode(evt.type+" " +evt.target);
+
          var k = "";
 +
          if (c) {
 +
            k = "(" + keyCode(c) + ")";
 +
          }
 +
           var t = document.createTextNode(evt.type+" " + evt.target + " " + c + " " + k);
 
           d.appendChild(t);
 
           d.appendChild(t);
           var d2 = document.getElementById("d2");
+
           var log1 = document.getElementById("log1");
           d2.appendChild(d);
+
           log1.appendChild(d);
           d2.scrollTop = d2.scrollHeight - d2.clientHeight;
+
           log1.scrollTop = log1.scrollHeight - log1.clientHeight;
 
           //Log the event to Console, so that the event object details may be inspected if desired.
 
           //Log the event to Console, so that the event object details may be inspected if desired.
 
           console.log(e);
 
           console.log(e);
Line 39: Line 44:
  
 
       function setup() {
 
       function setup() {
var elements = ['s1','i1','b1','a1','d1','d2'];
+
var elements = ['s1','i1','b1','a1','d1','d2','d3','d4','r1','c1'];
 
var el;
 
var el;
  
Line 81: Line 86:
 
     <button onfocus="test(event);" id="b1"> Do nothing </button>
 
     <button onfocus="test(event);" id="b1"> Do nothing </button>
  
     <a aria-label="SSB" tabindex="0" href="#" id="a1">SSB </a>
+
     <a aria-label="Level Access" tabindex="0" href="#a1" id="a1">Level Access</a>
 +
    <label><input type="checkbox" id="c1" >Order now!</label>
 
     <div id="d1" tabindex="0" onclick="goSomewhere();" > div area with tabindex </div>
 
     <div id="d1" tabindex="0" onclick="goSomewhere();" > div area with tabindex </div>
 
     <div id="d2" onclick="goSomewhere();" > div area with no tabindex </div>
 
     <div id="d2" onclick="goSomewhere();" > div area with no tabindex </div>
 
     <div id="d3" onclick="goSomewhere();" >  
 
     <div id="d3" onclick="goSomewhere();" >  
     <div id="d4" >div area with no tabindex and delegat </div>
+
     <div id="d4" >div area with no tabindex and delegate </div>
 +
    <input type="radio" id="r1"> <span>Unlabeled radio button</span>
 
     </div>
 
     </div>
 
   <h3>Log area</h3>
 
   <h3>Log area</h3>
     <div id="d2" aria-live="polite" >
+
     <div id="log1" aria-live="polite" >
<button onclick="setup();"> start</button>
+
      </div>
     </div>
+
    <button onclick="setup();"> start</button>
  </div>
+
    <script type="text/javascript">
  </body>
+
        module = [];
 +
     </script>
 +
    <script type="text/javascript" src="https://unpkg.com/keycode">
 +
</body>
 
</html>
 
</html>
 
[[Category:Techniques]]
 
[[Category:Techniques]]

Latest revision as of 17:49, 28 September 2021

Move through the fields below and watch the events that are sent by the browser. For example, use with AT to find out what events are being fired.

  • onfocus, onblur, onclick, ondbclik, onmouseup, onmousedown, onmouseover
  • onkeypress, onkeydown, onkeyup, touchstart, touchend, touchmove, touchcancel

Event types and their target object will be displayed in the section below. Raw event objects will also be logged to the browser console, and may be reviewed with the developer tools.

Level Access
div area with tabindex
div area with no tabindex
div area with no tabindex and delegate
Unlabeled radio button

Log area