[jQuery] Re: Defining regular expressions with # selector ??

2008-05-15 Thread bjorsq
If you want to get a set whose IDs start with "div1.", then you can use: $('[EMAIL PROTECTED]') You could also filter the result set with a regex like this: $('div').filter(function(){ return /^div1\./.test(this.id); }) Orcun Avsar-2 wrote: > > > Is it possible to define a regex with a # sel

[jQuery] Re: Defining regular expressions with # selector ??

2008-05-15 Thread motob
CORRECTION TO THE ABOVE CODE. the if statement needs to read: if($(a).attr('id').indexOf('div1') != -1) On May 15, 10:41 am, motob <[EMAIL PROTECTED]> wrote: > I think this would be possible, but you would need to write a custom > selector expression. You can refer to this > link:http://www

[jQuery] Re: Defining regular expressions with # selector ??

2008-05-15 Thread motob
I think this would be possible, but you would need to write a custom selector expression. You can refer to this link: http://www.malsup.com/jquery/expr/. You might be able to get away with something like this. jQuery.extend(jQuery.expr[':'], { startsWithDiv1: function(a){ //a = DOM elemen