I'm trying to get the value of fields object in the array o . I'm not able to get the value inside the property. What am I doing wrong?
var o = {
  "templatename": "sdgds",
  "fields": {
    "s1_req_1": 1,
    "s1_req_2": 1,
    "s1_req_3": 1,
    "s1_req_4": 1,
    "s1_req_5": 1,
    "s1_req_6": 1,
    "s1_req_7": 1,
    "s1_req_8": 1,
    "s1_req_9": 1,
    "s1_req_10": 1,
    "s1_req_11": 1,
    "s1_req_12": 1,
    "s1_req_13": 1,
    "s1_req_14": 1,
    "v1_dm_1": 1,
    "v1_dm_5": 1,
    "v1_dm_6": 1,
    "f1_fs_3": 1,
    "f1_fs_1": 1,
    "f1_fs_2": 1,
    "e3_eh_19": 1,
    "f1_fs_11": 1,
    "s3_sh_1": 1,
    "s3_sh_6": 1,
    "s3_sh_7": 1,
    "v1_dm_7": 1,
    "v1_dm_13": 1,
    "v1_dm_9": 1
  },
  "customerid": 'SMRTsspd'
};
$('#template').val(o.templatename);
$(o.fields).each(function(t) {
  $('input[value=' + t.name + ']').prop('checked', true);
}); 
     
     
     
     
     
    