1$(document).ready(function() {
2 $('#submit').click(function() {
3 var list = ['Car', 'Bike', 'Scooter'];
4 for (var value of list) {
5 $('#container')
6 .append(`<input type="checkbox" id="${value}" name="interest" value="${value}">`)
7 .append(`<label for="${value}">${value}</label></div>`)
8 .append(`<br>`);
9 }
10 })
11});
12
1<div class="tab-content col-md-12"
2style=" width:600px;
3 box-shadow: 3px 3px 3px 3px grey;
4 margin:10px;
5 background-color: #E0D8D6;
6 ">
1function Branches() {
2
3 function Branch() {
4 var _id;
5
6 _id = Math.round(Math.random()*10);
7
8 this.getId = function() {
9 return _id;
10 }
11
12 }
13
14 this.createBranch = function() {
15 var branch = new Branch;
16 _branches.push(branch);
17 }
18
19 this.getBranches = function() {
20 return _branches;
21 }
22
23 this.getBranchIds = function() {
24 var branch_list = this.getBranches();
25
26 var branch_ids = [];
27
28 for (var i = 0; i < branch_list.length; i++) {
29 var branch_id = branch_list[i].getId();
30 branch_ids.push(branch_id);
31 }
32
33 return branch_ids;
34 }
35
36 var _branches = [];
37
38}
39
40// code test
41var test = new Branches;
42
43for (var i = 0; i < 7; i++) {
44 test.createBranch();
45}
46
47console.log("Branch IDs:\n" + test.getBranchIds());
48