For dropdown options you probably want something like this:
(对于下拉选项,您可能想要这样的东西:)
var conceptName = $('#aioConceptName').find(":selected").text();
The reason val()
doesn't do the trick is because clicking an option doesn't change the value of the dropdown--it just adds the :selected
property to the selected option which is a child of the dropdown.
(val()
不能解决问题的原因是,单击选项不会更改下拉菜单的值,它只是将:selected
属性添加到作为下拉菜单的子级的selected选项中。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…