I have multiple select tags with names as d[brk1], d[brk2], d[brk3] etc.
I’m trying to select all of them by using
var break_tags = $('select[name^="d[brk]"]'); // returns empty
However, if I use exact name instead of ‘starts with’
var break_tags = $('select[name="d[brk2]"]'); // works
What I tried
var break_tags = $('select[name^="d\\[brk\\]"]'); // does not work
var break_tags = $('select[name^="d[]"]'); // no luck again
I’m unable to find a workaround this, though I’m sure I’m missing something very basic.
Any help appreciated. Thanks in advance
If you have inputs with
d[brkn]where n is a number, you’ll want this as your selector: