jQuery Get Selected Option From Dropdown

前端 未结 30 3892
梦如初夏
梦如初夏 2020-11-22 02:56

Usually I use $(\"#id\").val() to return the value of the selected option, but this time it doesn\'t work. The selected tag has the id aioConceptName

30条回答
  •  一个人的身影
    2020-11-22 03:18

    For good practice you need to use val() to get value of selected options not text().

    
    
    
    

    You can use

       $("#aioConceptName").find(':selected').val();
    

    Or

       $("#aioConceptName :selected").val();
    

    I wish that helps ..

提交回复
热议问题