Team:Tsinghua/try
From 2010.igem.org
<script> function Ok_OnClick(event) { if(document.getElementsByName("textName")[0].value == ""){ alert("请输入内容"); return; }//getElementById var table; var tableList = document.getElementsByTagName("TABLE"); for(var i = 0 ; i < tableList.length ; i++) { if(tableList[i].name == "tableName") { table = tableList[i] break; } } var value = document.getElementsByName("textName")[0].value; var index = table.rows.length; table.insertRow(index); table.rows(index).insertCell(0); table.rows(index).cells(0).innerText = value; document.getElementsByName("textName")[0].value = ""; } </script>
Contents |