源码如下
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
<script type="text/jscript" language="jscript">
function click(va)
{
alert(va);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="checkbox" id="checkbox1" onclick="click(this.value)" value=11 />11
</div>
</form>
</body>
</html>
我点击checkbox的时候,没有checkbox事件,但如果我改成
<input type=checkbox id="checkbox1" onclick="alert(this.value)" value=11>
却能触发。那我该怎么改,让别人选择是触发时间
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
<script type="text/jscript" language="jscript">
function click(va)
{
alert(va);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="checkbox" id="checkbox1" onclick="click(this.value)" value=11 />11
</div>
</form>
</body>
</html>
我点击checkbox的时候,没有checkbox事件,但如果我改成
<input type=checkbox id="checkbox1" onclick="alert(this.value)" value=11>
却能触发。那我该怎么改,让别人选择是触发时间
改成
<script language="javascript" type="text/javascript">
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<script language="javascript" type="text/javascript">
function zclick(va)
{
alert(va);
}
</script> <body>
<form id="form1" runat="server">
<div>
<input type="checkbox" id="checkbox1" onclick="zclick(this.value)" value=11 />11
</div>
</form>
</body>
</html>