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>
  <sell-button></sell-button>
  
  <template id="sellBtn">
    <style>
      :host {
        --orange: #e67e22;
        --space: 1.5em;
      }
      .btn-container {
        border: 2px dashed var(--orange);
        padding: var(--space);
        text-align: center;
      }
      .btn {
        background-color: var(--orange);
        border: 0;
        border-radius: 5px;
        color: white;
        padding: var(--space);
        text-transform: uppercase;
      }
    </style>
    <div class="btn-container">
      <button class="btn">Comprar Ahora</button>
    </div>
  </template>
</body>
</html>
 
class SellButton extends HTMLElement {
  constructor () {
    super();
  }
  
  connectedCallback () {
    let shadowRoot = this.attachShadow({mode: 'open'});
    const t = document.querySelector('#sellBtn');
    const instance = t.content.cloneNode(true);
    shadowRoot.appendChild(instance);
  }
}
window.customElements.define('sell-button', SellButton)
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers