Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一系列具有这种 id 结构的 INPUT 标签。
id="menu_popSearch_chk1_I" id="menu_popSearch_chk2_I" id="menu_popSearch_chk3_I"
等等但是,所以我不想要这些
id="menu_popSearch_chk1_S" id="menu_popSearch_chk2_S" id="menu_popSearch_chk3_S"
是否有一种“通配符”类型的功能,我可以获得第一组,但不能获得第二组。
$('input[id$=_I]')
在这里阅读
编辑:或者你可以做
$('input[id^=menu_popSearch]').not('input[id$=_S]')
编辑 2:好的,当你不断完善问题时,我会尽量跟上
$('input[id^=menu_popSearch][id$=_I]')
现在在这里阅读