Simple and clean:
$('#select_all').click(function() {_x000D_
var c = this.checked;_x000D_
$(':checkbox').prop('checked', c);_x000D_
});
_x000D_
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>_x000D_
<form>_x000D_
<table>_x000D_
<tr>_x000D_
<td><input type="checkbox" id="select_all" /></td>_x000D_
</tr>_x000D_
<tr>_x000D_
<td><input type="checkbox" name="select[]" /></td>_x000D_
</tr>_x000D_
<tr>_x000D_
<td><input type="checkbox" name="select[]" /></td>_x000D_
</tr>_x000D_
<tr>_x000D_
<td><input type="checkbox" name="select[]" /></td>_x000D_
</tr>_x000D_
</table>_x000D_
</form>
_x000D_