<!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=gb2312" />  
<script src="lib/jquery-1.6.4.min.js" type="text/
javascript"></script>  
<!--script src="lib/jquery-1.4.4.js" type="text/javascript"></script-->  
<script type="text/javascript">  
$(document).ready(  
    function(){  
        $("#jianrong").click(sovle_jquery_virsion);  
        $("#test").click(function(){  
            //如果是1.4版本得到的数据时boolean类型的  
            //如果是1.6版本得到的结果是字符串  
            if(true == $("#show_img_title").attr("
checked")){  
                alert("是字符串true");  
            }  
            if("checked" == $("#show_img_title").attr("checked")){  
                alert("是字符串checked!");  
            }  
        });  
    }  
);  
  
//解决不同版jquery的问题,可以用下面的方式判断  
function sovle_jquery_virsion(){  
    if("checked" == $('#show_img_title', parent.document.body).attr("checked") || true == $('#show_img_title', parent.document.body).attr("checked")){  
        alert("多选框被选中!");  
    }else{  
        alert("多选框没有被选中!");  
    }  
}  
  
</script>  
<title>jquery实现选中checkbox复选框_www.jb200.com</title>  
</head>  
<input type="checkbox" id="show_img_title" style="vertical-align:-3px;"><label style="margin: 0 0 0 4px;" for="show_img_title">照片标题描述带入日记</label><br>  
<button id="test">test</button><br>  
<button id="jianrong">兼容性问题测试</button>  
<body>  
</body>  
</html>