我怎么知道组合框/选择框中是否有任何选项?
小编辑:
我有我的组合框 myCombo = $("#country");
现在我想知道myCombo中有多少个选项
最佳答案
在 jQuery 中:
if($('select#something option').length > 0) {
// There are some.
...
关于javascript - 我如何找到组合框中选项的长度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4060211/