.each() functions not working correctly
Hi, I have a function with the following code:
- function saveRecord(){
- $("#weekSheet tbody tr").each(function(){
- $('td').each(function(i,o){
var value = ( $(":first-child", this).is(":input") )
? $(":first-child", this).val()
: ( ($(this).text() != "")
? $(this).text()
: $(this).html() ) ;
alert(value);
});
alert("next row has started");
});
}
Basically, I am iterating through rows of a table. Everything is fine except the second alert (highlighted in red) is not being called at all. I want to know when the next row (<td>) has started and I am assuming once the inner .each() is finished it should call the second alert and then again go back to the loop.