Issue with find with optgroup when label has a +
I have this code:
- $(this).closest('.filter')
- .find('optgroup[label=' + text + '] option')
- .prop('selected', true);
This works fine, except when text contains a + - in that case everything from all the
optgroups are matched, instead of just the ones from the group specified. Does + cause some special behavior? I tried escaping it with \, but I got the same results. How can I make this work properly when the label as a +?