Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<button tabindex=1>1</button>
<button tabindex=2 id="b">2</button>
<dialog>
  Hello
  <button tabindex=1>dialog 1</button>
  <button tabindex=2>dialog 2</button>
</dialog>
<script>
  "use strict";
  const dialog = document.querySelector("dialog");
  
  document.querySelector("#b").addEventListener("click", () => {
    dialog.open = !dialog.open;
//    dialog.showModal();
  });
</script>
<p>It turns out that you can still tab through the document even if the dialog is open, which seems to be against the spec.</p>
Output

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers