1 <html xmlns="http://www.w3.org/1999/xhtml">
2 <head>
3 <title></title>
4
5 <script language="javascript" src="js/jquery-1.5.js">
6 </script>
7
8 <script language="javascript">
9 //这个只适用于选中一项显示一项
10 $(function() {
11 $("input[value=显示选中项]").click(function() {
12 alert($("input:checked").val());
13 })
14 })
15 </script>
16
17 </head>
18 <body>
19 <input type="checkbox" value="aa" />aa
20 <input type="checkbox" value="bb" />bb
21 <input type="checkbox" value="cc" />cc
22 <input type="checkbox" value="dd" />dd
23 <input type="button" value="显示选中项" />
24 </body>
25 </html>