Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

inserting rows into a table 1

Status
Not open for further replies.

AlbertAguirre

Programmer
Nov 21, 2001
273
US
New to JS. Please help?

Why doesnt this function insert 10 rows?

upon execution it inserts one row but it DOES iterate through the loop 10 times.



function insRow(pTable){
var dynamicTable=document.getElementById(pTable).insertRow(0)
var cell01=dynamicTable.insertCell(0)
var cell02=dynamicTable.insertCell(1)

var i=0
while (i<=10){
cell01.innerHTML="NEW CELL1"
cell02.innerHTML="NEW CELL2"
i=i+1
}
}
</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top