Code:
<div class="checkbox-animated-inline">
<input id="brands" type="checkbox" ng-model="brands" ng-click="checkBrand(brands,'brands')">
<label for="brands">
<span class="check"></span>
<span class="box" style="z-index:9 !important"></span>
<strong>brands</strong>
</label>
</div>
Input:
array of brands=[Maytag,Panda,Samsung,Whirlpool];
Required output:
<div class="checkbox-animated-inline">
<input id="Maytag" type="checkbox" ng-model="Maytag" ng-click="checkBrand(Maytag,'Maytag')">
<label for="Maytag">
<span class="check"></span>
<span class="box" style="z-index:9 !important"></span>
<strong>Maytag</strong>
</label>
</div>
<div class="checkbox-animated-inline">
<input id="Panda" type="checkbox" ng-model="Panda" ng-click="checkBrand(Panda,'Panda')">
<label for="Panda">
<span class="check"></span>
<span class="box" style="z-index:9 !important"></span>
<strong>Panda</strong>
</label>
</div>
<div class="checkbox-animated-inline">
<input id="Samsung" type="checkbox" ng-model="Samsung" ng-click="checkBrand(Samsung,'Samsung')">
<label for="Samsung">
<span class="check"></span>
<span class="box" style="z-index:9 !important"></span>
<strong>Samsung</strong>
</label>
</div>
<div class="checkbox-animated-inline">
<input id="Whirlpool" type="checkbox" ng-model="Whirlpool" ng-click="checkBrand(Whirlpool,'Whirlpool')">
<label for="Whirlpool">
<span class="check"></span>
<span class="box" style="z-index:9 !important"></span>
<strong>Whirlpool</strong>
</label>
</div>
Tried code :
#include <stdio.h>
#include <strings.h>
typedef char * string;
int main(void)
{
string strs[5]; // Make 5 strings
int i;
strs[0] = "Maytag";
strs[1] = "Panda";
strs[2] = "Samsung";
strs[3] = "Whirlpool";
for(i = 0;i < 4;++i)
printf("<div class="checkbox-animated-inline">
<input id="%s" type="checkbox" ng-model="%s" ng-click="checkBrand(%s,'%s')">
<label for="%s">
<span class="check"></span>
<span class="box" style="z-index:9 !important"></span>
<strong>%s</strong>
</label>
</div> ",strs[i]);
return 0;
}
I tried the above code but it is showing me a lot of errors. My question is, how can I replace the brand with the list of brands and display the output using loop or by using a function? If there are any tools that can replace the word with list of elements from the array.