1
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 place the content of div.preco-a-vista
within the 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 prices from the page (from the price-to-view div) and puts in all div price. Repeating everything. Could you help me with this question?
When you put the contents of
.preco-a-vista
inside.preco
what happens to.preco-a-vista
? gets duplicated or is to remove?– Sergio
It is to remove Sérgio! And currently in the code is getting..
– André Silva