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.maintain.hidden Example</title>
</head>
<body>
<article id="example-introduction">
  <h1><code>ally.maintain.hidden</code> Example</h1>
  <p>
    Use the <code>toggle hidden</code> button to hide all elements (except the buttons and what&apos;s within the blue border).
    Use the <code>add elements</code> button to see that the <code>aria-hidden</code> attribute is applied to dynamically added content as well.
    Note that the hidden elements are visualized with red border and background only for this demo.
  </p>
</article>
<div id="example-html">
  <main>
    <button id="toggle" type="button">toggle hidden</button>
    <button id="add" type="button">add elements</button>
    <hr>
    <div id="uncle-1">
      <div id="cousin-1">Cousin</div>
    </div>
    <div id="parent">
      <div id="target">Target</div>
      <div id="sibling">Sibling</div>
    </div>
    <div id="uncle-2">
      <div id="cousin-2">Cousin 2</div>
      <div id="target-2">Target 2</div>
    </div>
  </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