Posted by: CIGG June 11, 2008
Need help in Java Script and JSP
Login in to Rate this Post:     0       ?        

Just like the table should have an id that you are using to refer the table from javascript, each td should also have an id.

Id you are creating the table dynamically then you should generate a dynamic id for each TD too. Once each td has its own ID. You can juse Javascript to refer to a particular TD using that Id. Lets say you assign a td an id 'TD1'. then in javascript to get that particular TD the code would be:

var td1 = document.getElementById('td1');

then,

td1.innerHtml = "<img src='http://www.myweb.com/myimage.jpg'>";

 

Read Full Discussion Thread for this article