Skip to content
Loading
Change colour using for loop.  
  • class="col-md-4">  
  • class="back-color">  
  • class="plan">  
  • class="topclr1"> -- this section black colour  
  •  Standard

      
  •  Monthly $399

      
  • Annualy $3990

      
  •   
  • "grey">  
  •   
  • lorem ipsum  
  •   
  • lorem ipsum
  •   
  • lorem ipsum
  •   
  • lorem ipsum
  •   
  • lorem ipsum
  •   
  • class="choose1" type="button">Choose Plan  
  •   
  •   
  •   
  •   
  • class="col-md-4">  
  • class="back-color">  
  • class="plan">  
  • class="topclr2"> -- this section bluee colour  
  •  Premium

      
  •  Monthly $499

      
  • Annualy $4990

      
  •   
  • "blue">  
  • lorem ipsum
  •   
  • lorem ipsum
  •   
  • lorem ipsum
  •   
  • lorem ipsum
  •   
  • lorem ipsum
  •   
  • class="choose2" type="button">Choose Plan  
  •   
  •   
  •   
  •   
  •   
  • But i have use this code with foreach loop
    1. for (var i = 0; i < response.items.length - 1; i++) {  
    2. html += '';  
    3. html += ';  
    4. html += '';  
    5. html += ''; --bcz here call topclr class  
    6. html += '

       ' + response.items[i].name + '

      '
      ;  
    7. html += '

      ' + response.items[i].interval + + response.items[i].unitAmount + '

      '
      ;  
    8. html += '
    ';  
  • html += '';  
  • html += 
  • ';  
  • html += 'Choose Plan';  
  • html += '';  
  • html += '';  
  • html += '';  
  • html += '';  
  • three section display same colour.So i want to display three section with different-2 colour

    2 Replies

    Know the answer? Post it — somebody with the same question will find it here.