车险买什么公司的好:有关html下拉框的一个属性?

来源:百度文库 编辑:中科新闻网 时间:2024/04/30 09:23:20
怎样获得下拉框所选的值?我用document.form_name.对象.value
会出现,对象为空或.......的错误提示

试试document.all.formName.对象.value或document.getElementById('对象').value

注意:下拉框处前者使用name='', 后者使用id=''.

text

document.formName.对象.options[document.formName.对象.selectedIndex].value