问题:
Using jQuery, how do you check if there is an option selected in a select menu, and if not, assign one of the options as selected. 使用jQuery,如何检查在选择菜单中是否选择了选项,如果没有,则将其中一个选项指定为选中。
(The select is generated with a maze of PHP functions in an app I just inherited, so this is a quick fix while I get my head around those :) (选择是在我刚刚继承的应用程序中使用迷宫般的PHP函数生成的,所以这是一个快速解决方案,而我可以解决这些问题:)
解决方案:
参考一: https://en.stackoom.com/question/cuT参考二: https://stackoom.com/question/cuT