I used jquery select all checkboxes to try and get a check all checkboxes button. Using the code from this answer, My button disappears immediately as seen on this Fiddle
JS:
$(function(){
$('#checkAll').toggle(
function(){
$('#numberList .numberClass').prop('checked',true);
},
function(){
$('#numberList .numberClass').prop('checked',false);
});
});
HTML:
<div id='numberList'>
<table>
<tr>
<th>
<input type='button' id='checkAll' name='checkAll' value='Check All'>
</td>
</tr>
<tr>
<td>
<input class='numberClass' type='checkbox' id='number[" . $k . "]' name='number[" . $k . "]'>
</td>
</tr>
<tr>
<td>
<input class='numberClass' type='checkbox' id='number[" . $k . "]' name='number[" . $k . "]'>
</td></tr>
</table>
</div>
what is so obvious that i am missing?
$('#checkAll').click(