Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  <div id="container"></div>
  
  Composed:
  <code id="output"></code>
  
  <script>
    let root = container.attachShadow({mode: 'open'});
    let button = document.createElement('button');
    button.innerText = 'Hello world!';
    button.addEventListener('click', e => {
      output.innerText += e.composed;
    });
    root.appendChild(button);
    button.click();
  </script>
</body>
</html>
Output 300px

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

Dismiss x
public
Bin info
keanuleepro
0viewers