This example demonstrates how data in an HTML table can be read using JavaScript which can further be used for submitting to a server side script.
In this example, we first get the reference of the table using the function call
var table = document.getElementById('productlist');
Then loop through each row of the table.
Each time data read from a cell is added to a string separated by a delimiter ( here we used "," ).
Finally the data read is displayed by using alert() function.
Entire code of this example is given below: