Reputation: 2344
I have a lot of doms with these names:
<input id="partido1-jugada4-empate" name="bets[3][0][0]" title="partido1-jugada4-empate" type="radio" value="X">
<input id="partido1-jugada4-empate" name="bets[3][1][0]" title="partido1-jugada4-empate" type="radio" value="X">
...
<input id="partido1-jugada4-empate" name="bets[3][13][0]" title="partido1-jugada4-empate" type="radio" value="X">
I need select these with something like:
$( "input[name*='[3][*][0]']" )
where previous line give some input with that name
Upvotes: 2
Views: 152
Reputation: 401
As this question here suggests
jQuery selector for matching at start AND end of ID
You should do the following:
$("input[name ^=//[13//]][name $=//[0//]")
So it reads if the name starts with [13] and ends with [0]
The backslashes '//' are used to tell jQuery that '[' and ']' are not it's reserved brackets.
Edit:
The proper answer is thanks to:
In the comments below :)
Upvotes: 2