My goal is to iterate over a table with an ID of ajaxResponse1 and store each COLUMN'S values in a separate array. Each of the entries in valuesArr will be a column containing an array of individual values.
I tried using new Array instead of new Object, but I still don't seem to be getting any output alerted to my screen. Should I be using some combination of .push to get each new column value into the appropriate array? Hope that's clear. Any ideas? Thanks!
var valuesArr = new Object();
$('#ajaxResponse1 tr').each( function() {
var colNum = 0;
$('th, td', this).each( function() {
valuesArr[colNum] = valuesArr[colNum].push( $(this).html() );
colNum++;
});
});
alert(JSON.stringify(valuesArr));