Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>ally.query.tabbable Example</title>
</head>
<body>
<article id="example-introduction">
  <h1><code>ally.query.tabbable</code> Example</h1>
  <p>All elements with a green background are considered keyboard focusable (tabbable).</p>
</article>
<div id="example-html">
  <main>
    <p><label for="text-input">Text Input 1</label><input type="text" id="text-input" value="input without tabindex"></p>
    <p><label for="text-input--1">Text Input 2</label><input type="text" id="text-input--1" value="input tabindex=&quot;-1&quot;" tabindex="-1"></p>
    <p><label for="text-input-2">Text Input 3</label><input type="text" id="text-input-2" value="input tabindex=&quot;2&quot;" tabindex="2"></p>
    <div>div without <code>tabindex</code></div>
    <div tabindex="-1">div with <code>tabindex=&quot;-1&quot;</code></div>
    <div tabindex="0">div with <code>tabindex=&quot;0&quot;</code></div>
    <div tabindex="1">div with <code>tabindex=&quot;1&quot;</code></div>
    <p><label for="text-input-auto">Text Input with autofocus</label><input type="text" id="text-input-auto" value="input with autofocus" autofocus></p>
  </main>
</div>
<script src="https://cdn.jsdelivr.net/ally.js/1.4.1/ally.min.js"></script>
</body>
</html>
 
div {
  margin-top: 5px;
  padding: 5px;
  border: 1px solid grey;
}
.is-tabbable {
  background: #00DD00;
}
  
 
ally.query.tabbable().forEach(function(element) {
  element.classList.add('is-tabbable');
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
rodneyrehmpro
0viewers