JSFiddle - React, Tailwind, and code Playground

by Neal

HTML

<div class="outer">
  <a class="btn">
   <img src="btnImg.jpg" />
  </a>
  Some Title
</div>

JavaScript

var text = $.trim($('.outer').text());
$('.outer').append($('<input>', {value: text}))