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>Declarative Shadow DOM</title>
  <style>
    [slot="s1"]:not(:last-of-type) {
      display: none;
    }
  </style>
</head>
<body>
    <div id="t">
      <template shadowrootmode="open">
        <slot part="p1" name="s1">s1</slot>
        <slot name="s2">s2</slot>
        <slot name="s3">s3</slot>
      </template>
    </div>
    <script>
      setTimeout(_=> t.innerHTML += `<span slot="s3">three</span>`, 1000)
      setTimeout(_=> t.innerHTML += `<span slot="s1">one</span>`, 2000)
      setTimeout(_=> t.innerHTML += `<span slot="s2">two</span>`, 3000)
      setTimeout(_=> t.innerHTML += `<span slot="s1">ONE</span>`, 4000)
    </script>
</body>
</html>
Output 300px

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

Dismiss x
public
Bin info
anonymouspro
0viewers