JSFiddle - React, Tailwind, and code Playground
HTML
<p>Hello</p>
<button id="switch">replace</button>
CSS
p {
background-color: red;
}
div {
background-color: yellow;
}
JavaScript
$(function(){
$('#switch').bind('click', function(){
$('p').replaceWith($('<div/>').html($('p').html()));
});
});