JSFiddle - React, Tailwind, and code Playground

HTML

<script type="text/template" id="new">
    <div id="el">Yo</div>
</script>

<div id="container">
    <button id="go">Paste here</button>
</div>

JavaScript

var $el = '',
    goBtn = $('#go'),
    $container = $('#container'),
    newTpl = $('#new');

goBtn.on('click', function(){
  $container.html(newTpl.html());
  $el = $('#el');  
  alert($el.length);
});