Getting an option text/value with JavaScript

后端 未结 4 1909
迷失自我
迷失自我 2020-11-30 07:00

Answer: var option_user_selection = element.options[element.selectedIndex].text

I am trying to build a form that fills in a person\'s o

4条回答
  •  伪装坚强ぢ
    2020-11-30 07:35

    var option_user_selection = document.getElementById("maincourse").options[document.getElementById("maincourse").selectedIndex ].text
    

提交回复
热议问题