I particularly love Vue.js
.
With it you can leave the rendering dynamics of html in real time. This example automates the process of displaying content.
Now you just need to receive this data from an API without having to worry about changing the html document every time your database or API add a new product.
var app = new Vue({
el: '#check',
data: {
checks: [
{label: 'APPLE' , values: ['IPHONE' , 'IPAD'] , check:false},
{label: 'LG' , values: ['TVs' , 'SMARTPHONES'] , check:false}
]
}
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.16/vue.min.js"></script><divid="check">
<div v-for="check in checks" >
<label >{{check.label}}</label>
<input type="checkbox" v-on:click="check.check = check.check == false ? true : false">
<select v-if="check.check">
<option v-for="value in check.values " v-bind:value="value" >{{value}}
</select>
</div>
</div>