I have a page that contains several structures with the same selector, such as:
<div class="preco">
R$ 69,90
</div>
<div class="preco-a-vista">
R$ 50,00
</div>
As I mentioned, the above structure repeats several times on the page. I need to put the content of div.preco-a-vista
within div.preco
I made the following code:
$('.preco-avista').each(function() {
var $this = $(this);
$('.preco').append($($this).html());
});
This code works, but it takes all the prices of the page (from the pre-a-view div) and puts all the price div. Repeating everything. Could you help me with this question?