object - javascript dom conflict: how to start at column 2 -
my javascript dom model conflicting. have exporttable on 1 side generate indexnumber , on other side imports data (firsname, lastname , points importform. try indexnumber on column 1, firstname in 2, lastname in 3 , points in 4.
at moment indexnumber in column 1(good) firstname starts in column 1 (not good). if adding (see script) newrow.insertcell(1); console protests.
who can me?
<script> var button3 = document.getelementbyid("button2"); button3.onclick= adddata; function adddata() { // collect data firstname, lastname, points var firstname = document.getelementbyid("firstname"); var lastname = document.getelementbyid("lastname"); var points = document.getelementbyid("points"); var exporttable = document.getelementbyid("exporttable"); var newrow = exporttable.insertrow(-1); var cel1 = newrow.insertcell(0); //i can not start here insertcell(0); var cel2 = newrow.insertcell(1); var cel3 = newrow.insertcell(2); cel1.innerhtml = firstname.value; cel2.innerhtml = lastname.value; cel3.innerhtml = points.value; //instal number var amountrows = exporttable.rows.length; (var = 1; < amountrows; i++) { exporttable.rows[i].children[0].innerhtml = i; } } </script>
Comments
Post a Comment