js给select下拉框赋值 js如何清除select中的值?

js如何清除select中的值?想法:获取select tag元素。选择“选择”下的选项。替换选项中的内容,或删除选项。代码:<script>window.onload=函数(){var oS

js如何清除select中的值?

想法:获取select tag元素。选择“选择”下的选项。替换选项中的内容,或删除选项。代码:<script>window.onload=函数(){var oSel=文档.getElementById(“sel”)var oOpt=新选项(“123”,“abc”)小孩儿(oopt)//添加一个OptionSel.removeChild选项(oopt)//删除选项}</script></head><body><select id=“sel”>< option> 1234</选项></选择>