<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$( function(){
$('.chk_all').click(function(){
if( $('.chk_all').prop('checked') )
{
$('.chk').prop('checked',true);
}
else
{
$('.chk').prop('checked',false);
}
});
});
</script>
<input type="checkbox" class="chk_all" name="chk_all" id="chk_all" value="1"><br><br>
<input type="checkbox" class="chk" name="chk1" id="chk1" value=""><br>
<input type="checkbox" class="chk" name="chk2" id="chk2" value=""><br>
<input type="checkbox" class="chk" name="chk3" id="chk3" value=""><br>
<input type="checkbox" class="chk" name="chk4" id="chk4" value=""><br>