我想在Jquery中为选择器编写正则表达式
我有一个ID为r1:0:newPincode098SelState::content
的组件,其中newPincode098SelState
是常见的,另一部分会因不同的组件而异
页面。我想为包含上面字符串的所有组件调用.On()函数。
到目前为止,我已尝试$("input:contains('newPincode098SelState')")
,但这无效。
答案 0 :(得分:1)
$("input:regex(attributeName, yourRegexp)")
答案 1 :(得分:0)
尝试 - attribute-contains-selector
$("input[id*='newPincode098SelState']")