Skip to content

Instantly share code, notes, and snippets.

@keithics
Created January 24, 2013 05:45
Show Gist options
  • Save keithics/4617986 to your computer and use it in GitHub Desktop.
Save keithics/4617986 to your computer and use it in GitHub Desktop.
Easy toggle check to All checkboxes
<table>
<tr>
<td>I Lead: <input type="checkbox" id="toggle_select" /></td>
</tr>
<tr>
<td>We Follow :<input type="checkbox" class="toggle_type" /></td>
</tr>
<tr>
<td>We Follow :<input type="checkbox" class="toggle_type" /></td>
</tr>
<tr>
<td>We Follow :<input type="checkbox" class="toggle_type" /></td>
</tr>
<tr>
<td>We Follow :<input type="checkbox" class="toggle_type" /></td>
</tr>
<tr>
<td>We Follow :<input type="checkbox" class="toggle_type" /></td>
</tr>
</table>
<script type="text/javascript">
$(document).ready(function(){
$('#toggle_select').click(function(e){
$('.toggle_type').prop('checked',$(this).is(':checked'));
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment