JSFiddle - React, Tailwind, and code Playground

JavaScript

//var $new = $().add("");  //can't use this object in the loop
   // var $new = $([]);        //can't use this object in the loop
    //var $new = $();        //can't use this object in the loop
    //var $new = $("#nonexistingelement"); //can't use this object in the loop
   // var $new = $().add("<tr>");  //works but I don't want to add any html at this point. 
                
   
        $new.append("<sometag>");
                        
   

alert($new.html());  //should display only the html that was added