JSFiddle - React, Tailwind, and code Playground
HTML
<p>Lorem ipsum</p>
<h4>text here</h4>
<p>Lorem ipsum</p>
JavaScript
$('h4').replaceWith(function() {
return $('<h1 />', { html: $(this).html() });
});
<p>Lorem ipsum</p>
<h4>text here</h4>
<p>Lorem ipsum</p>
$('h4').replaceWith(function() {
return $('<h1 />', { html: $(this).html() });
});