我需要一些帮助,我如何获得复选框值而不是所选的选项。如何获取复选框值而不是选定的选项?
$(function() {
$('#addAsociado').click(function() {
// This is the selected option, I want checkbox value
return !$('#a_selectCta option:selected').appendTo('#contenedorLista');
});
$('#removeAsociado').click(
function() {
// This is the selected option, I want checkbox value
return !$('#a_selectCta option:selected').remove().appendTo('#contenedorLista');
});
});
$('#a_selectCta option:selected').val()? –
@YuriyGalanter no $('#a_selectCta option:selected')是一个选择选项,我想要一个复选框的值。我已经试过$('#a_checkBox:checked')。val(),但不起作用! – paulinajr
你是什么意思的复选框值? – NWard