Getting the text from a drop-down box

后端 未结 12 2335
无人及你
无人及你 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 03:01

    function getValue(obj)
    {  
       // it will return the selected text
       // obj variable will contain the object of check box
       var text = obj.options[obj.selectedIndex].innerHTML ; 
    
    }
    

    HTML Snippet

     
    
    

提交回复
热议问题