Sorry for the newbie question but I must be overlooking something. How do I set obj.{this.name} = property
so obj.sandwich = off. My object would look something like:
obj { sandwich: off, soup: off }
List of checkboxes:
<input type = "checkbox" name = "sandwich" />
<input type = "checkbox" name = "soup" />
js code:
var obj = {} ;
$('input[type=checkbox]:not(:checked)').map(function()
{
var item_name = this.name;
var value = 'off';
obj.item_name = value;
}).get();
console.log (obj);