<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript" language="javascript">
function onmuse(id)
{
id.style.background-color="red";
} </script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input id="enter" value="enter" type="button" onclick="onmuse(text1)"/>
<div id="text1" style="width:745px; border:solid 4px red; height:68px"></div>
</div>
</form>
</body>
</html>
请问我哪里写错了!!怎么不能改变《div》的背景
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript" language="javascript">
function onmuse(id)
{
id.style.background-color="red";
} </script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input id="enter" value="enter" type="button" onclick="onmuse(text1)"/>
<div id="text1" style="width:745px; border:solid 4px red; height:68px"></div>
</div>
</form>
</body>
</html>
请问我哪里写错了!!怎么不能改变《div》的背景
解决方案 »
- 在ASP中用marquee和DataList实现了动态的公告栏,在怎么实现无间隔的滚动
- 编码转换问题
- 动态生成DataGird 摸板列里添加CheckBox控件(在线)
- 菜鸟问题:怎样约束文本框的输入?
- ASP.NET 网站上下有空白
- [求助]高分求权限管理类的源代码与实例!^_^
- .net 通过OLEDB获取excel数据,插入oracle之后,中文成“???”怎么解决啊?
- 100分求助,关于一个web.config的配置问题,我明天就有交差了(在线等待),正确后立即结贴!!!
- 哪有visual studio .net 下载呀?
- 看看这个sql语句
- asp.net汇出excel调用Microsoft.Office.Interop.Excel设置 Dcom问题
- 担忧,CuteSoft_Client放在根目录不安全吧!
function onmuse(id)
{
document.getElementById(id).style.backgroudColor="red";
}
得先document.getElementById("id")找到对象,像一二楼那样
getElementByName()