Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嗨!我想从一个复选框中获取值,并使用该值设置另一个。我用jquery:$('#CommercialName').val($('#CommercialName2').is(':checked'));
$('#CommercialName').val($('#CommercialName2').is(':checked'));
利用.prop()
.prop()
var isChecked = $('#checkbox1').is(':checked'); $('#checkbox2').prop('checked', isChecked);