jQuery Get Selected Option From Dropdown

前端 未结 30 4108
梦如初夏
梦如初夏 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:26

    to fetch a select with same class= name you could do this, to check if a select option is selected.

    var bOK = true;
    $('.optKategorien').each(function(index,el){
        if($(el).find(":selected").text() == "") {
            bOK = false;
        }
    });
    

提交回复
热议问题