or you could use attribute-ends-with-selector$('select[id$="end"]').each(function () { console.log(this.id);}); 更新要选择前3个,您可以像这样使用:lt(3)To select the first 3 you can use :lt(3) like this$('select[id^="begin"]:lt(3)').each(function () { console.log(this.id);}); 演示 更新要合并选择器,您可以这样做To combine the selectors you can do this$('select[id^="begin"][id$="end"]').each(function () { console.log(this.id);}); 演示如果您要选择ID以 OR 开头的元素,则可以使用,来获取两个不同的选择器If you want to select an element with id that starts with begin OR end you can do this using , to get two different selectors$('select[id^="begin"],select[id$="end"]').each(function () { // ^ console.log(this.id);}); 演示 这篇关于jQuery选择器以获取具有ID模式的所有选择下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!