Skip to content

Instantly share code, notes, and snippets.

<!doctype html>
<html>
<head>
<!-- Polyfills only needed for Firefox and Edge. -->
<script src="https://unpkg.com/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
</head>
<body>
<!-- Works only on browsers that support Javascript modules like
Chrome, Safari, Firefox 60, Edge 17 -->
<script type="module">

Keybase proof

I hereby claim:

  • I am jcrestel on github.
  • I am jcrestel (https://keybase.io/jcrestel) on keybase.
  • I have a public key ASDHQ_lU43MKysUeErxyI2lzuCzLH6cpvjanEttqOg5oigo

To claim this, I am signing this object:

<template id="hello-world">
<p>Hello World</p>
</template>
<script>
const templateHelloWorld = (document.currentScript || document._currentScript)
.ownerDocument.querySelector('#hello-world').content;
class HelloWorld extends HTMLElement {
connectedCallback() {
let shadowRoot = this.attachShadow({mode: 'open'});