Using either raw javascript or jQuery, I need to get the text from a select that is in a table cell. I have attached the code that I have gotten to work and almost get me what I need.
var tbl = document.getElementById('tblHours');
var rowCount = tbl.rows.length;
var colCount = tbl.rows[0].cells.length;
for (var i = 0;i<rowCount;i++) {
var myrow = tbl.rows[i];
for (var j=0;j<colCount;j++) {
alert(myrow.cells[j].firstChild.innerHTML);
}
}
The problem with this code is it gets me the raw html for the select, and I need to know what text is actually selected. Thanks!
Switch to jquery!
I didnt test code. Just for example.