JSFiddle - React, Tailwind, and code Playground

by mgiuffrida

HTML

<template id="templ">
  <script>console.error('This does not execute!');</script>
</template>

JavaScript

var t = document.createElement('template');
var s = document.createElement('script');
s.innerHTML = 'console.log("But this does!")';
t.appendChild(s);
document.body.appendChild(t);
console.log(t.children[0].tagName == 'SCRIPT');
console.log(t.children[0].ownerDocument == document);

// Meanwhile...
console.log(templ.children.length == 0);