size方法比较简单,除了这个就只有模拟操作了。
1 2 3 4 5 6 7 |
< select size = "1" name = "D1" id = "test1" >
< option >1</ option >
< option >2</ option >
< option >3</ option >
< option >4</ option >
</ select >
< input type = "button" value = "提交" name = "B1" onclick = "if(test1.size==1){test1.size=test1.length} else{test1.size=1}" >
|
你可以写成js。
标签:test1,触发,option,name,onclick,select,size From: https://www.cnblogs.com/jmbt/p/16608601.html