JSFiddle - React, Tailwind, and code Playground

HTML

<div id="root"><span>1</span></div>
<div id="out" />

JavaScript

for( var id in $('#root span')){
   //alert(id);
    $('<div />', {text: id}).appendTo($('#out'));
}