<script>
functionOk_OnClick(event)
{
if(document.getElementsByName("textName")[0].value ==""){
alert("请输入内容");
return;
}//getElementById
var table;
var tableList =document.getElementsByTagName_r("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>
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html;charset=gb2312">
<TITLE>留言版</TITLE>
<STYLE>
td{width:20%;height:20px;border-bottom:1px solidblack;border-right:1px solidblack;cursor:default;}
div{font-size:13px;}
th{height:20px;font-size:12px;font-weight:normal;border-bottom:2pxsolidblack;background-color:#CCCCCC}
table{border:1px solidblack;font-size:13px;}
</STYLE>
</HEAD>
<BODY oncontextmenu="returnfalse;"">
<TABLE name="tableName" width="70%" align="center"cellpadding="0"cellspacing="0">
<TR>
<TH colspan="4">留言版</TH>
</TR>
<TR>
<TD>呵呵,一个超简陋的留言版^_^</TD>
</TR>
</TABLE>
<BR>
<divalign="center">
<textarea rows="2" name="textName" id="textId"cols="20"
>
</textarea>
</div>
<BR>
<divalign="center">
<input type="button" value="提交" onclick="returnOk_OnClick(window.event);"
>
<!--position: absolute; left: 342; top: 184;-->
</div>
</BODY>
</HTML>