Getting contents of table cell

Getting contents of table cell

  1. for(i=0; i<lotteries.length; i++){
                                    document.write("\
                                    \
                                    \
                                    <table id='lot"+[i]+"'><tr>\
                                    \
                                    <td>\
                                    <table border='3'>\
                                    \
                                    <tr> <script language='javascript'> if(lotteries[i][5]=='') {document.write('<td width='+(lotteries[i][3]*7+12)+' align=center bgcolor=white>1-'+lotteries[i][3]+'</td>')} else{if(lotteries[i][7]==''){if(lotteries[i][5]==1){document.write('<td width='+(lotteries[i][3]*7+3)+' align=center bgcolor=white>1-'+lotteries[i][3]+'</td> <td width='+(lotteries[i][5]*7+3)+' align=center bgcolor=white>'+(lotteries[i][3]+1)+'</td>')} else{document.write('<td width='+(lotteries[i][3]*7+3)+' align=center bgcolor=white>1-'+lotteries[i][3]+'</td> <td width='+(lotteries[i][5]*7+3)+' align=center bgcolor=white>'+(lotteries[i][3]+1)+'-100</td>')}} else{if(lotteries[i][7]==1){document.write('<td width='+lotteries[i][3]*7+' align=center bgcolor=white>1-'+lotteries[i][3]+'</td> <td width='+lotteries[i][5]*7+' align=center bgcolor=white>'+(lotteries[i][3]+1)+'-'+(lotteries[i][3]+lotteries[i][5])+'</td> <td width='+lotteries[i][7]*7+' align=center bgcolor=white>'+(lotteries[i][3]+lotteries[i][5]+1)+'</td>')} else{document.write('<td width='+lotteries[i][3]*7+' align=center bgcolor=white>1-'+lotteries[i][3]+'</td> <td width='+lotteries[i][5]*7+' align=center bgcolor=white>'+(lotteries[i][3]+1)+'-'+(lotteries[i][3]+lotteries[i][5])+'</td> <td width='+lotteries[i][7]*7+' align=center bgcolor=white>'+(lotteries[i][3]+lotteries[i][5]+1)+'-100</td>')}}} </script> </tr>\
                                    \
                                    <tr> <td width="+lotteries[i][3]*7+" align=center bgcolor=99ccff BORDERCOLOR=black id='out1"+[i]+"'><FONT SIZE='6'>&#163;"+lotteries[i][2]+"</FONT></td> <script language='javascript'> if(lotteries[i][5]=='') {} else{if(lotteries[i][7]==''){document.write('<td width='+lotteries[i][5]*7+' align=center bgcolor=99ccff BORDERCOLOR=black id=\"out2'+[i]+'\"><FONT SIZE=6>&#163;'+lotteries[i][4]+'</FONT></td>')} else{document.write('<td width='+lotteries[i][5]*7+' align=center bgcolor=99ccff BORDERCOLOR=black id=\"out2'+[i]+'\"><FONT SIZE=6>&#163;'+lotteries[i][4]+'</FONT></td> <td width='+lotteries[i][7]*7+' align=center bgcolor=99ccff BORDERCOLOR=black id=\"out3'+[i]+'\"><FONT SIZE=6>&#163;'+lotteries[i][6]+'</FONT></td>')}} </script> </tr>\
                                    \
                                    <tr> <td width="+lotteries[i][3]*7+" align=center bgcolor=white><FONT SIZE='4'><i>"+lotteries[i][3]+"%</i></FONT></td> <script language='javascript'> if(lotteries[i][5]=='') {} else{if(lotteries[i][7]==''){document.write('<td width='+lotteries[i][5]*7+' align=center bgcolor=white><FONT SIZE=4><i>'+lotteries[i][5]+'%</i></FONT></td>')} else{document.write('<td width='+lotteries[i][5]*7+' align=center bgcolor=white><FONT SIZE=4><i>'+lotteries[i][5]+'%</i></FONT></td> <td width='+lotteries[i][7]*7+' align=center bgcolor=white><FONT SIZE=4><i>'+lotteries[i][7]+'%</i></FONT></td>')}} </script> </tr>\
                                    \
                                    </table>\
                                    </td>\
                                    \
                                    </tr></table>\
                                    \
                                    \
                                    <table><tr><td height=15></td></tr></table>\
                                    \
                                    \
                                ")};


I have the above bit of JavaScript that adds a table



I want to be able to change the content of



  1. <td width="+lotteries[i][3]*7+" align=center bgcolor=99ccff BORDERCOLOR=black id='out1"+[i]+"'><FONT SIZE='6'>&#163;"+lotteries[i][2]+"</FONT></td>

How do I get hold of it?



alert($( "#out11" ).text()); displays nothing

and alert($( "#out11" ).html());  displays undefined




Thanks