javascript_删除所有select下面的option的方法
/增加之前删除所有option
while ( length != 0 ) {
var length = document . getElementById ( 'courseorder' ) . options . length ;
for ( var i = 0 ; i & lt ; length ; i ++ ) {
document . getElementById ( 'courseorder' ) . options . remove ( i ) ;
length = length / 2 ;
}
}
javascript_创建一个option节点
op = document . createElement ( "option" ) ;
op . value = 0 ;
//表明没有安排到科次
te = document . createTextNode ( "没有安排到课次" ) ;
op . appendChild ( te ) ;
document . getElementById ( "courseorder" ) . appendChild ( op ) ;