javascript - change html of a div present in another set of div from the anchor tag targeted present inside another div -
i trying change html of div present inside div using each function on anchor tag present in div . html format
<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"> </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
$('.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 can see trying put value inside .p-countdown want done under this . value being returned used alerts check still not able target .p-countdown correctly .
Comments
Post a Comment