<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>checkBox4radio.html</title> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="this is my page"> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(function () { var allBox = $(":checkbox"); //var allBox = $("#div input:checkbox"); allBox.click(function () { allBox.removeAttr("checked"); $(this).attr("checked", "checked"); }); $(":button").click(function () { alert($(":checkbox:checked").val()); }); }); </script> </head> <body> <input type="button" value="remove" /> <div> <input type="checkbox" value="1"/> <input type="checkbox" value="2"/> <input type="checkbox" value="3"/> <input type="checkbox" value="4"/> </div> </body> </html>