JSFiddle - React, Tailwind, and code Playground
HTML
<body>
<div>
<ul><li>Hello</li><li>World</li></ul>
<h4>Price</h4>Some text<br />some more text
</div>
</body>
JavaScript
$(document).ready(function(){
var $div = $('div');
var removed = $div.contents().slice($div.contents().length - 4).remove();
if (confirm('Add the price nodes back?'))
{
$('div').append(removed);
}
});