I am trying to create a JSON object with values of list of check boxes.
The key attribute of the object should be the checkbox id, i am getting it like this.
var elementId = $(this).attr("id");
This is my complete code.
var ImportParameters = [];
$('#divImportOptions .ace').each(function (index, obj) {
debugger;
var elementId = $(this).attr("id");
var elementValue = $(this).is(':checked');
ImportParameters.push({ elementId : elementValue });
});
My output currently is like this.
{elementId: true}
My Required output is like this
{ chkAllowDetailsInfo : true}
What should i do in order to get the desired output ?