I have tried may ways and it just starts at 0 then adds 1 and stays at one no matter how many cells are there what am I doing wrong? <html> <head> <script type="text/javascript"> function insCell() { var apples = 0 if (apples<5) { apples ++ var x=document.getElementById('tr1').insertCell(0) x.innerHTML="John" alert("Apples value: " + apples) } } </script> </head> <body> <table border="1"> <tr id="tr1"> <td>Peter</td> </tr> </table> <br /> <input type="button" onclick="insCell()" value="Insert cell"> </body> </html> Code (markup):
yah I figure that out the hard way... thanks for the input... I have been looking at the replies on this topic and always saw 0 but when I click on the topic I noticed you replied wtf.
Glad you figured it out. Coincidentally I changed my signature yesterday so that it doesn't contain a link - though I don't know why that would stop my replies showing on the forum display. If it keeps on happening I'll get in touch with DigitalPoint.