我想获取所有没有空值的选择选项,然后在更改事件上克隆它们。我这可能吗?
这是我的代码:
$(function() {
$("#ddlSecurityQuestions1").change(function() {
var index = $(this).val();
$('#ddlSecurityQuestions2').empty();
$('#ddlSecurityQuestions1 option').clone().appendTo('#ddlSecurityQuestions2');
var otherDropDown=document.getElementById('ddlSecurityQuestions2');
otherDropDown.options.remove(index);
});
});