For table rows, you can select all inputs similar to this:
var myInputFields = $("#myTable tr input[type='text']");
This will only select the input, no matter how many levels are in the depth of the table, so you can have lines with div> s, p> s and other things wrapped around input> s.
You can use jQuery.each or just for i = 0-> myInputFields.length to scroll through all the input fields.
myInputFields.each(function(i,v){ var v = $(v); console.debug(v.html(),v.val()); });
You can expand the selector for more input / text fields, etc. easy as in the answer to simoncereska.
source share