<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>CheckBox_checked</title> <script type="text/javascript" src="http://cdn.staticfile.org/jquery/2.1.1-rc2/jquery.js"></script> <!-- <script type="text/javascript" > $(document).ready(function (){ var hiddens = $("input[type='text'][name='check']"); $.each(hiddens,function (){ var val=$(this).val(); var checkboxs = $("input[type='checkbox'][name='about'][value="+val+"]"); $.each(checkboxs,function (){ this.checked="checked"; }); }); }); </script> --> <script type="text/javascript" > $(document).ready(function (){ var str = "1,3,"; var name=new Array() name = str.split(","); for (var i = 0; i < name.length; i++) { var checkboxs = $("input[type='checkbox'][name='about'][value="+name[i]+"]"); $.each(checkboxs,function (){ this.checked="checked"; }); } }); </script> </head> <body> <!-- <input type="text" name="check" value="2"/> <input type="text" name="check" value="3"/> --> <input type="checkbox" name="about" value="1" /> 1 <br/> <input type="checkbox" name="about" value="2" /> 2 <br/> <input type="checkbox" name="about" value="3" /> 3 <br/> </body> </html>