<html>
<head>
<script type="text/javascript">
function aa()
{
document.getElementById("aaa").style.color="red";
}
</script>
</head>
<body>
<div id="aaa">
<form id="form1">
<input id="Button1" type="button" value="button" onclick="aa()" /> //点击没反应,也没提示出错
</form>
</div>
</body> </html>
<head>
<script type="text/javascript">
function aa()
{
document.getElementById("aaa").style.color="red";
}
</script>
</head>
<body>
<div id="aaa">
<form id="form1">
<input id="Button1" type="button" value="button" onclick="aa()" /> //点击没反应,也没提示出错
</form>
</div>
</body> </html>
<head>
<script type="text/javascript">
function aa(obj)
{
obj.style.color="red";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<input id="Button1" type="button" value="button" onclick="javascript:aa(this)" /> //指定一下this也可以
</form>
</body>
</html>