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.style.focusSource Example</title>
</head>
<body>
<article id="example-introduction">
  <h1><code>ally.style.focusSource</code> Example</h1>
  <p>Use <kbd>Tab</kbd> and the mouse (or touch) as well as the buttons to focus the input elements to see them styled differently depending on the input method used.</p>
</article>
<div id="example-html">
  <main>
    <button type="button" id="focus-pass">loading&#x2026;</button>
    <button type="button" id="focus-lock" aria-pressed="false">loading&#x2026;</button>
    <hr>
    <label for="before-input">click me</label>
    <input id="before-input" type="text" value="before styled">
    <div class="example">
      <div id="first-shadow-host"></div>
      <div>
        <input id="outer-input" type="text" value="outer input">
      </div>
    </div>
    <input id="after-input" type="text" value="after styled">
    <hr>
    <p data-had-focus="pointer">focus was set by pointer at least once</p>
    <p data-had-focus="key">focus was set by keyboard at least once</p>
    <p data-had-focus="script">focus was set by script at least once</p>
  </main>
</div>
<script src="https://cdn.jsdelivr.net/ally.js/1.4.1/ally.min.js"></script>
</body>
</html>
Output 300px

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

Dismiss x
public
Bin info
rodneyrehmpro
0viewers