我下面的代码返回与它关联的“价格”类的每个文本。我只想返回每个语句所在的特定项目的价格..
<div class="item">
<p class="price">$388.00</p>
<p class="part_number">VM2327T23A00T</p>
<p class="real_price"></p>
</div>
<div class="item">
<p class="price">$88.00</p>
<p class="part_number">AA327T23A00T</p>
<p class="real_price"></p>
</div>
<div class="item">
<p class="price">$38.00</p>
<p class="part_number">AA327T23A00T</p>
<p class="real_price"></p>
</div>
<script>
jQuery('.part_number').each(function () {
parts.push(jQuery(this).text());
var aPrice= jQuery('.price').text();
});
</script>