I have these values:
var firstHeader = $('#header0').text(); // 6KP
var secondHeader = $('#header1').text(); // 7KP
var thirdHeader = $('#header2').text(); // 8KP
var first = $('#input0').val(); // 77
var second = $('#input1').val(); //88
var third = $('#input2').val(); // 99
And I need to create a JSON object to have this:
{6KP:77, 7KP:88, 8KP:99}
I tried to do this but without success:
var data = { firstHeader: first, secondHeader: second, thirdHeader: third };
data = JSON.stringify(data, null, ' ');
And my response is this:
{firstHeader: 77, secondHeader:88, thirdHeader:99}
How can I put the values instead of these var names?