Hai friends,
I am retrieving the data from html table to an array in jquery.
I had used the following code.
$("#crt").live("click", function () {
var arr = [];
$("#tblcomponent tbody tr").each(function (i) {
debugger;
var value = $(this).find("td").text();
arr.push($(this).find("td").text());
});
});
I am getting the output of a row as
1hari2500
i need it as 1,hari,2500
please help me.


Bhushan BhasmeRank #2,348 · 604 reputationPosted Jun 19, 2015, 4:26 AM EDT
table.find('tr').each(function (i, el) { var $tds = $(this).find('td'), productId = $tds.eq(0).text(), product = $tds.eq(1).text(), Quantity = $tds.eq(2).text(); // do something with productId, product, Quantity });Bhushan BhasmeRank #2,348 · 604 reputationPosted Jun 19, 2015, 3:37 AM EDT
----OR-----------
var Row = document.getElementById("somerow"); var Cells = Row.getElementsByTagName("td"); alert(Cells[0].innerText); -----or----------- $('#mytable tr').each(function(){ var customerId = $(this).find("td:first").html(); });Sreekanth ReddyRank #726 · 3.2K reputationPosted Jun 19, 2015, 4:20 AM EDT