JSFiddle - React, Tailwind, and code Playground

by princefiddle

HTML

<div id='main' class="main">
   vijay
    <span>
        web
    </span>
    tiwari
    <span>
        developer
    </span>
 </div>

JavaScript

$(document).ready(function(){
                $text='';
                      alert('test');
                $test=  $( ".main" ).clone().appendTo('#main');
                $test.children('span').remove();
                $text=$test.html();
                alert($text);
                $test.remove();
     
                 
    
                  
                  
});