情况是这样子的,我点击div复选框被选中,但是我直接点复选框是点不动的,这个问题怎么处理啊 10
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/...
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>DEmo</title>
<meta name="Description" content="demo" />
<script src="js/jquery.js" type="text/javascript"></script>
</head>
<body>
<div style="height:50px;width:50px;background:#CEE0F4;margin:220px 0 0 120px;" class="ff">
<input type="checkbox" name="chk" />
</div>
</body>
<script>
$(".ff").click(function(){
var chk=$(this).find(":checkbox");
if(chk.is(':checked'))
{
chk.removeAttr("checked");
//$("[name='chk']").attr("checked",'true')
}
else
{
chk.attr("checked",true);//取消全选
}
})
</script>
</html> 展开
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>DEmo</title>
<meta name="Description" content="demo" />
<script src="js/jquery.js" type="text/javascript"></script>
</head>
<body>
<div style="height:50px;width:50px;background:#CEE0F4;margin:220px 0 0 120px;" class="ff">
<input type="checkbox" name="chk" />
</div>
</body>
<script>
$(".ff").click(function(){
var chk=$(this).find(":checkbox");
if(chk.is(':checked'))
{
chk.removeAttr("checked");
//$("[name='chk']").attr("checked",'true')
}
else
{
chk.attr("checked",true);//取消全选
}
})
</script>
</html> 展开
1个回答
展开全部
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>DEmo</title>
<meta name="Description" content="demo" />
<script src="jquery.js" type="text/javascript"></script>
</head>
<body>
<div style="height:50px;width:50px;background:#CEE0F4;margin:220px 0 0 120px;" class="ff">
<input type="checkbox" name="chk" />
</div>
</body>
<script>
$(".ff").click(function(){
var chk=$(this).find(":checkbox");
if(chk.is(':checked'))
{
chk.removeAttr("checked");
//$("[name='chk']").attr("checked",'true')
}
else
{
chk.attr("checked",true);//取消全选
}
})
$(".ff").find(":checkbox").click(function(){
var chk=$(this);
if(chk.is(':checked'))
{
chk.removeAttr("checked");
//$("[name='chk']").attr("checked",'true')
}
else
{
chk.attr("checked",true);//取消全选
}
})
</script>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>DEmo</title>
<meta name="Description" content="demo" />
<script src="jquery.js" type="text/javascript"></script>
</head>
<body>
<div style="height:50px;width:50px;background:#CEE0F4;margin:220px 0 0 120px;" class="ff">
<input type="checkbox" name="chk" />
</div>
</body>
<script>
$(".ff").click(function(){
var chk=$(this).find(":checkbox");
if(chk.is(':checked'))
{
chk.removeAttr("checked");
//$("[name='chk']").attr("checked",'true')
}
else
{
chk.attr("checked",true);//取消全选
}
})
$(".ff").find(":checkbox").click(function(){
var chk=$(this);
if(chk.is(':checked'))
{
chk.removeAttr("checked");
//$("[name='chk']").attr("checked",'true')
}
else
{
chk.attr("checked",true);//取消全选
}
})
</script>
</html>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询