Can't add new row to table

Darlene

New Member
\[code\]function load(){ var row="<tr><td><select id=\"chooseclass\"><option value=http://stackoverflow.com/"math\">Math</option><option value=http://stackoverflow.com/"phys\">Physics</option><option value=http://stackoverflow.com/"lit\">Literature</option><option value=http://stackoverflow.com/"chem\">Chemistry</option><option value=http://stackoverflow.com/"bio\">Biology</option><option value=http://stackoverflow.com/"lang\">Language</option><option value=http://stackoverflow.com/"proj\">Project</option><option value=http://stackoverflow.com/"elec\">Elective</option></select></td><td><input id=\"choosemods\" type=\"text\" /></td><td><input id=\"choosegrade\" type=\"text\" /></td></tr>"; var tablebody = document.getElementById("classestable"); tablebody.innerHTML += "<tbody></tbody>"; tablebody.getElementsByTagName("tbody").innerHTML = ""; for(var i=0;i<15;i++){ tablebody.getElementsByTagName("tbody").innerHTML += row; }}\[/code\]The code above runs fine except the contents of \[code\]row\[/code\] does not get added to \[code\]tbody\[/code\]. \[code\]console.log\[/code\] shows that the contents of \[code\]row\[/code\] is valid html and there are no errors in the console. Why is that not being added?
 
Back
Top