I'm having a hard time in getting the data. I don't know where I went wrong.
Button:
<button class="btn btn-primary" style="font-size: 10px;" onclick="save()">Save</button>
Data coming from:
//index is dynamic from another js
var hide = '<label><input type="radio" class="menuOptions" name="save' + index + '" id="access' + index + '" value="0" ' + (access == 0 ? 'checked' : (access == 3 ? 'disabled' : '')) + ' <?php isset($access) ? ($access == 1 ? "disabled" : "") : "disabled" ?>/>Hide</label>';
function save() {
var a = [];
for (var i = 0; i != data.length; i++) {
a.push({
'value': $('input[name="save' + i + '"]:checked').val()
});
}
console.log(a)
}
Data: When I console.log(a)
[Object, Object, Object, Object]
0: Object
a: 2
title: 'MyTitle'
__proto__: Object
1: Object
a: 2
title: 'AnotherTitle'
__proto__: Object
So on and so forth.