jQuery復(fù)選框更改并單擊事件$(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?");
}
});});<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script><input type="checkbox" id="checkbox1"/><br /><input type="text" id="textbox1"/>
jQuery復(fù)選框更改并單擊事件
有只小跳蛙
2019-07-25 18:53:05