I have a page that is filled with radiobuttonlists whose IDs start with either “inc” or “exc” for inclusion/exclusion questions. I am able to select all the inclusion buttons with $('input[name^="inc"]') and all the exclusions with $('input[name^="exc"]'). Since I am binding both types of buttons with the same function I wanted to combine my select statement to grab both sets of elements.
I tried $('input[name^="inc|exc"]') but this doesn’t select anything. I tested that it found nothing by looking at the length and it is zero. I tried a couple other ways but they all result in no matches.
To sum up the problem, using jquery, I need to find all inputs whose name start with “inc” or “exc”
1 Answer