I’d like to retrieve all elements which start with a specific ID. After a short search, the solution appeared to be:
$('*[id^="foo_"]')
to select all elements with an ID starting with foo_. Although this selector syntax is very logical, I was just wondering whether it is possible to do this in a more ‘shorthand’ way, like:
$('#foo_*');
This did not work, however. Is there support for wildcarting like this?
As far as I know, there’s no native way to do this.
However, here is a filter that allows regular expressions to be used for selectors. It should suit you just fine.