在html页面中我想点击一个按钮使table中某一单元格里面显示的字变色.

xenium xenium 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
这样写出错,不知道原因?
<html>
<head>
<title>Untitled Document</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
</head>
<body>
<script language=javascript>
function test()
{
form2.test.style.color="blue";
}
</script>
<form id="form2">
<TABLE id="Table1" cellSpacing="1" cellPadding="1" width="300" border="1">
<TR>
<TD></TD>
<TD></TD>
<TD></TD>
</TR>
<TR>
<TD></TD>
<TD id="test" style="COLOR: green">123</TD>

<TD>
<input id="Button1" type="button" value="Button" name="Button1" onClick="test()">
</TD>
</TR>
<TR>
<TD></TD>
<TD></TD>
<TD></TD>
</TR>
</TABLE>
</form>
</body>
</html>
希望找出原因或有另外的实现方法.
...全文

相关推荐

评论 4
收藏 已收藏
分享
返回顶部
xenium
CSS 61,117 成员 60,701 内容