I'm try to create an array but data come back empty, it does not seem to be working, any help would be appreciated. I've updated the and added the html. appreciate you all for your patience.
I'm still getting [object Array]: [] when my the results are yielded.
<table class="table table-bordered table-framed" id="seconDTable" style="display:block;" i>
<tbody id="secondtbody">
<tr name="myRow">
<td style="width: 100%;">
<input type="text" name="ParentTitle" value="book1">
<select id="ddlPageCount" style=" width: 35px; padding - top: 1px; height: 20px; font - size: 14px; color: #555555; vertical - align: left; background - color: #ffffff;1px solid #cccccc;border - radius: 1px; ">
@for (int i = 1; i < 10 + 1; i++)
{
<option value="@i">
@i
</option>
}
</select>
</td>
</tr>
<tr name="myRow">
<td style="width: 100%;">
<input type="text" name="ParentTitle" value="book2">
<select id="ddlPageCount" style=" width: 35px; padding - top: 1px; height: 20px; font - size: 14px; color: #555555; vertical - align: left; background - color: #ffffff;1px solid #cccccc;border - radius: 1px; ">
@for (int i = 1; i < 10 + 1; i++)
{
<option value="@i">
@i
</option>
}
</select>
</td>
</tr>
</tr>
}
}
</tbody>
</table>
var rows = document.getElementById("seconDTable").getElementsByTagName("myRow").length;
var data = [];
$("table tbody tr").each(function () {
var textval = $(this).find("td").find("input[type=text][name=ParentTitle]").val();
var ddlval = $(this).find("td").find("select option:selected").val();
for (var i = 0; i < rows ; i++) {
data.push{[
"Title": textval,
"PageNumber": ddlval
]};
}
console.log(data);
})