<html>
<head>
<title></title>
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script language=JavaScript>
//전체 선택/해제
function selectAll(){
var c = $('#checkAll').attr('checked');
$('input[name=chkid]').attr('checked',c);
}
//선택된 값 보기
function getSelectVal(){
var idlist = [];
var itemstr ="";
$('input[name=chkid]:checked').each(function(){idlist.push(this.value)});
$.each(idlist,function(index, item){
itemstr += item + ',';
});
$('#resultID').text(itemstr);
}
</script>
</head>
<body>
<input type="checkbox" id="checkAll" class="chk" onclick="selectAll()" /> 전체선택<P/>
<input type="checkbox" name="chkid" value="1" class="chk" />1<P/>
<input type="checkbox" name="chkid" value="2" class="chk" />2<P/>
<input type="checkbox" name="chkid" value="3" class="chk" />3<P/>
<input type="checkbox" name="chkid" value="4" class="chk" />4<P/>
<input type="checkbox" name="chkid" value="5" class="chk" />5<P/>
<input type="checkbox" name="chkid" value="6" class="chk" />6<P/>
<input type="checkbox" name="chkid" value="7" class="chk" />7<P/>
<input type="button" id="showval" onclick="getSelectVal()" value="선택값 보기" />
당신이 선택하신 값은<span id="resultID"></span> 입니다.
</body>
</html>
[출처] [jQuery]checkbox 전체 선택|작성자 빽사장님