Published
- 1 min read
checkbox on click jquery
The solution for this is noted below
checkbox on click jquery
Solution
$(document).ready(function () {
//set initial state.
$('#textbox1').val($(this).is(':checked'))
$('#checkbox1').change(function () {
$('#textbox1').val($(this).is(':checked'))
})
$('#checkbox1').click(function () {
if (!$(this).is(':checked')) {
return confirm('Are you sure?')
}
})
})
Try other methods by searching on the site. That is if this doesn’t work