jQuery Minute™

…a jQuery Minute™ later and you're done!

Wildcard ID’s – Select by ID and Filter

without comments

Here’s a solution for selecting elements by ID and running a regex to filter the results:

$(‘*[@id]’).filter(function() {
var regex = /^regularExpressionToMatchIdsAgainst/;
return ( $(this).attr(‘id’).match(regex) !== null );

Written by jdsharp

December 21st, 2007 at 10:56 am

Posted in Code-bits

Leave a Reply