JSFiddle - React, Tailwind, and code Playground
HTML
<div class='jt-header'>a header</div>
<div class='jt-detail'>a detail
<div class='jt-item-price'>12.34</div>
</div>
<div class='jt-header'>another header
<div class='jt-item-price'>34.45</div>
</div>
<div class='jt-detail'>another detail</div>
CSS
.jt-header {
background: #eee;
padding: 10px;
margin-top: 10px;
}
.jt-detail {
background: #d8d8d8;
padding: 10px;
}
JavaScript
$(function(){
$('#move').on('click',function(){
$('.jt-detail .jt-item-price').each(function(){
$this = $(this);
$this.appendTo($this.closest('.jt-row').prev().find('.jt-header'));
});
});
});