JSFiddle - React, Tailwind, and code Playground

HTML

<div id="div">
  Here is the Converted  :&lt;span class="text"&gt; Text&lt;/span&gt; &lt;br /&gt;&lt;a href="javascript:void(0)"&gt;Link&lt;/a&gt;
  
    
</div>
<br />
<input type="button" class="go" value="Convert to HTML ">

JavaScript

$.fn.toHtml=function(){
       return $(this).html($(this).text())
    }
    $('.go').click(function(){
      $('#div').toHtml()
    
    });