答案:<HTML>
<HEAD>
<TITLE> JS模仿的DataGrid</TITLE>
</HEAD>
<SCRIPT LANGUAGE="javascript">
<!--
function ChangeValue(objTD)
{
var objName;
objName = objTD.id;
objTD.innerHTML = "<input type=text id=txtBox name=textfield value="+objTD.innerText+" onBlur=WriteNewValue(this.value,"+objName+");>";
}
function WriteNewValue(strTxt,objTD)
{
objTD.innerText = strTxt;
}//-->
</SCRIPT>
<BODY>
<TABLE width="500" align="center" cellpadding="1" cellspacing="1" bgcolor="#3333CC">
<TR bgcolor="#FFFFFF">
<TD height="30" id="td1" onDblClick="ChangeValue(this);"><P>QQQQQQ</P></TD>
<TD id="td2" onDblClick="ChangeValue(this);">fdsafas</TD>
<TD id="td3" onDblClick="ChangeValue(this);">fadsfasf</TD>
<TD id="td4" onDblClick="ChangeValue(this);">fs易做图sf</TD>
<TD id="td5" onDblClick="ChangeValue(this);">fdsaf</TD>
</TR>
</TABLE>
</BODY>
</HTML>
上一个:override与重载的区别
下一个:SQL SERVER中字段类型及说明