问题描述:

I am trying to change the html of a div which is present inside div using each function on a anchor tag which is present in another div . My html format is

<li class="Odd" style="width: 440px; height: 478px;">

<div class="ProductImage QuickView" data-product="79" style="height: 460px; width: 280px;"> <a href="http://www.exmp.com/midnight-splendor/"><img src="http://cdn2.exmp.com/n-biq04i/bxoxsg/products/79/images/278/jpeg__18621.1394537835.280.460.jpg?c=1" alt="Midnight Splendor"></a>

<div class="QuickViewBtn" style="background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgb(247, 247, 247)), to(rgb(220, 219, 219))); color: rgb(0, 0, 0); display: none; background-position: initial initial; background-repeat: initial initial;" data-product="79">Quick View</div>

</div>

<div class="ProductDetails" style="height: 0px;"> <a href="http://www.exmp.com/midnight-splendor/" class="pname"><strong>Midnight Splendor</strong></a>

<div class="ProductPriceRating hdmenw" style="height: 15px;"> <span class="Rating Rating4"><img src="http://www.exmp.com/templates/__custom/images/IcoRating0.gif" alt="" style=""></span>

</div>

<div class="ProductActionAdd" style="display:;"> <a href="http://www.exmp.com/midnight-splendor/" class="hdmenw icon-Choose Options" title="Choose Options">&nbsp;</a>

<em class="p-price"><strike class="RetailPriceValue">$40.00</strike> $20.00</em><em class="p-countdown"></em>

</div>

</div>

</li>

My jquery function is

$('.ProductImage a').each(function () {

var link = $(this).attr('href');

var $this = $(this);

$.ajax({

url: link,

success: function (data) {

var newImg = $(".d-date .Value div", data).html();

if (newImg == null) {

//Do Nothing

} else {

$this.parent(".ProductDetails").next('.p-countdown').html(newImg);

}

}

});

});

As you can see i am trying to put value inside .p-countdown but i want to be done under this . The value is being returned i used alerts to check it but still i am not able to target .p-countdown correctly .

相关阅读:
Top