dom - Query table cell contents from Javascript -


i'm having trouble using variable in following code snippet , wondered if correct mistake ...

function displayresult(x) { var myrowindex=x.rowindex; var mycell=document.getelementbyid('msgtable').rows[myrowindex].cells[0].childnodes[0].data; alert("cell content: " + mycell); } 

myrowindex being correctly populated, when used in definition of mycell error:

document.getelementbyid("msgtable").rows undefined 

my overall intention dynamically building table , users have option select row table. on selection more detail provided in separate box. table sortable first determine relevant rowindex , retrieve dataindex (which in cell[0]).

i seems work fine using test edit on w3schools site, in own code seem destroying rows object!

thanks, pete


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -