0

I want to append the value in the div when all the ajax calls are completed.

this is my html

 <div class="chbs-vehicle chbs-clear-fix">

         <div class="chbs-vehicle-image chbs-vehicle-image-has-gallery" style="opacity: 1;">
            </div>
            <div class="chbs-vehicle-content">                
                <div class="chbs-vehicle-content-header"> 
                    <span>Sedan</span>                        
            <a href="#" class="chbs-button chbs-button-style-2">
                Select
                <span class="chbs-meta-icon-tick"></span>
            </a>                       
               </div>                   
            <div class="chbs-vehicle-content-price">€42.00</div>                
            </div>
            </div>

I have also tried to add the hard quoted text in the html function but this is also not working

<script type="text/javascript">

jQuery(document).ready(function($){
  

      $('.chbs-button-style-2').on('click', function() {

      $('.chbs-vehicle-content-price').html("");
   
       $(document).ajaxComplete(function() {
   
       var cust_val =jQuery('.chbs-summary-price-element-total').children('span').eq(1).html();   
   
      // $('.chbs-vehicle-content-price').html(cust_val);

       $(this).closest('.chbs-vehicle-content').find('.chbs-vehicle-content-price').html("The value is "+cust_val);


    });

    });

   });
   
</script>
Tayyab Vohra
  • 1,279
  • 2
  • 15
  • 42
  • Your code doesn't make any AJAX calls...? In any case, put the `jqXHR` objects returned from the `$.ajax()` calls in an array and apply them to `$.when()`, then call `done()` and execute the code required in that block. – Rory McCrossan Jul 28 '21 at 19:47

0 Answers0