ction(index){
if(this.selected){
$(‘#inteachers’).append($(this));
}
});
});
//选中id是notinteachers的列表框中的某个选项,
//点击按钮b1该选项移动到id是inteachers列表框中
$(‘#b1′).click(function(){
var $options = $(‘#notinteachers option’);
var flag = false;
$options.each(function(index){
if( 空白处3 ){
flag = true;
$(‘#inteachers’).append($(this));
}
});
if(!flag){
alert(‘至少选择一个选项’);
}
});
//点击按钮b2, id是notinteachers的列表框中的所有移动到
//id是inteachers列表框中
$(‘#b2′).click(function(){
var $options = $(‘#notinteachers option’);
$options.each(function(index){
空白处4
});
});
//点击按钮confirm, id是inteachers列表框中的每个项全部处于选中状态
$(‘form’).submit(function(){
var $arr = $(‘#inteachers option’);
$arr.each(function(index){
空白处5
});
return true;
});
});