JSFiddle - React, Tailwind, and code Playground
HTML
<li>
<a href="/"> <img src="image.png"> text to be converted to element </a>
</li>
JavaScript
var anchor = $('li a');
anchor.after('<p>' + anchor.text() + '</p>')
.contents()
.filter(function(){
return (this.nodeType == 3);
})
.remove();