Getting the text from a drop-down box

后端 未结 12 2303
无人及你
无人及你 2020-11-30 02:23

This gets the value of whatever is selected in my dropdown menu.

document.getElementById(\'newSkill\').value

I cannot however find out what

12条回答
  •  Happy的楠姐
    2020-11-30 02:54

    document.getElementById('newSkill').options[document.getElementById('newSkill').selectedIndex].value 
    

    Should work

提交回复
热议问题