Edit in JSFiddle

$("#allcheck").change(function () {
    $(":checkbox").prop("checked", $(this).prop("checked"))
});
<form action="javascript:;">
    <input type="checkbox" />
    <input type="checkbox" />
    <input type="checkbox" />
    <input id="allcheck" type="checkbox" />
    <label for="allcheck"></label>
</form>
#allcheck {
    display:none
}
#allcheck + label:after {
    -webkit-appearance: button;
    -moz-appearance: button;
    appearance: button;
    padding: 3px 10px;
    cursor: pointer;
    content:"Check all";
}
#allcheck:checked + label:after {
    content:"Uncheck all";
}