Javascript访问,ASP.NET控件中Table控件的TableCell如何实现!!在线等~!请大家帮助一下!
小弟有一个程序需要使用Javascript来访问ASP.NET中Table控件的TableCell单元并对它其中的文本进行更改,但这个TableCell单元是不定的需要由单击时的一个变量来决定,以下在小弟尝试时写的代码不过没有实现想要的效果,请各位帮帮忙!
<html xmlns= "http://www.w3.org/1999/xhtml " >
<head runat= "server ">
<title> 无标题页 </title>
<script type= "text/javascript ">
function inputtable(row)
{
alert(row);
// k = document.getElementById[ "cel1 "].id;
// document.all.k.innertext = "45 ";
return false;
}
function doc()
{
var row;
row = "cel1 ";
inputtable(row);
alert( "end! ");
}
</script>
</head>
<body>
<form id= "form1 " runat= "server ">
<div>
<asp:Table ID= "Table1 " runat= "server ">
<asp:TableRow runat= "server " ID= "row1 ">
<asp:TableCell runat= "server " ID= "cel1 " > 123 </asp:TableCell>
<asp:TableCell runat= "server " ID= "cel2 "> </asp:TableCell>
</asp:TableRow>
<asp:TableRow runat= "server ">
<asp:TableCell runat= "server " ID= "cel3 "> </asp:TableCell>
<asp:TableCell &n