I'm trying to convert a table I've written in HTML into Javascript because I want the table to be dynamically generated (# of rows). The main issue I'm having is that the individual cells in the table are clickable and open up another html page. Unfortunately, the html onclick parameter doesn't work with document.write
statements Here is an examples of a table cell in HTML:
<td id=r1c1 align=center onclick=getTicket(1,'plan',1);><script language=JavaScript>document.write(getDate(1,plan, r1c1)); </script></td>
The functions in this line are predefined and work so I'm not going to post those, but the idea is that the function getTicket(..) is suppose to open up another html page.
My issues is how to get the onclick to work in JavaScript. I can create the cells in Javascript using document.write commands but don't really know how to make those cells clickable to run the function getTicket(..).