input checkbox Toggle , Check all, UnCheck all


http://jsfiddle.net/gubhaju/Vj6wY/3/


Checkbox 1
Checkbox 2
Checkbox 3

$(document).ready(function(){
$(‘#checkbox_toggle_inv’).toggle(function(){
$(‘:checkbox’).each(function () { this.checked = !this.checked; });

},function(){
$(‘:checkbox’).each(function () { this.checked = !this.checked; });
});

$(‘#checkbox_toggle’).toggle(function(){
$(‘input:checkbox’).attr(‘checked’,’checked’);
$(this).val(‘Uncheck all’)
},function(){
$(‘input:checkbox’).removeAttr(‘checked’);
$(this).val(‘Check all’);
})

})

Leave a Reply

Ваш адрес email не будет опубликован. Обязательные поля помечены *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>