Getting the text from a drop-down box

后端 未结 12 2343
无人及你
无人及你 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条回答
  •  没有蜡笔的小新
    2020-11-30 02:56

    This works i tried it my self i thought i post it here in case someone need it...

    document.getElementById("newSkill").options[document.getElementById('newSkill').selectedIndex].text;
    

提交回复
热议问题