A jQuery plugin to replace input checkbox and radio button with specific contents like iCheck.
Using bower is the simplest way.
bower install jquery.toggle-check --save-dev
Basic Way
$('.toggle-check').toggleCheck([
'<span>Open</span>',
'<span>Close</span>'
]);
with Callback
$('.toggle-check').toggleCheck([
'<i class="fa fa-circle-o"></i>',
'<i class="fa fa-check-circle-o"></i>'
], function(e, targetCheck){
alert(targetCheck.val());
});
Changing checked value by event
$('#checkbox').on('click', function(){
var checked = $(this).is(':checked');
$('.toggle-check').prop('checked', checked).change();
});
*You need call change().
This package is licensed under the MIT License.
Copyright 2015 Sukohi Kuhoh