JSFiddle - React, Tailwind, and code Playground
by jmpp77
HTML
<template id="tpl">
<h1></h1>
</template>
<word-count></word-count>
<word-count></word-count>
<word-count></word-count>
JavaScript
document.addEventListener('DOMContentLoaded', onReady);
function onReady() {
const tpl = document.querySelector('#tpl');
/* console.log(tpl.content) */;
}
class WordCount extends HTMLElement {
constructor() {
super();
console.log('Instanciated!');
}
}
customElements.define('word-count', WordCount);