[jQuery] Re: can you simplify this selector? easy for you...

2008-11-17 Thread ggerri
Hi Lisaraël thanks for your help and sorry for late reply - I was down with a flu :-( the odd idea was a great idea and it works perfectly :clap: It would also select the first td, but this is not a problem as its not input ready. thanks again GGerri Lisaraël wrote: $('#PG1_L03-table

[jQuery] Re: can you simplify this selector? easy for you...

2008-11-17 Thread ggerri
Karl Rick thanks a lot for your help and sorry for late reply - I was down with a flu :-( Karl's version with the each loop works fine. Lisaraël's solution is a bit simpler and works as col 1 is not input ready and all 'odd' td should get a binding. Thanks though for teaching me another way

[jQuery] Re: can you simplify this selector? easy for you...

2008-11-12 Thread Karl Swedberg
On Nov 12, 2008, at 9:05 AM, Rik Lomas wrote: This is completely untested, but this is a bit simpler: $('#PG1_L03-table').find('td:eq(3), td:eq(5), td:eq(7), td:eq(9)').find('input').bind.. That won't work, because it'll only select the 4th, 6th, 8th, and 10th TD. 2008/11/12

[jQuery] Re: can you simplify this selector? easy for you...

2008-11-12 Thread Rik Lomas
Following on from Karl, how about: $('#PG1_L03-table td:nth-child(2n+3)').slice(0, 4).find('input') 2008/11/12 Lisaraël [EMAIL PROTECTED]: $('#PG1_L03-table td:nth-child(odd) input') ? (untested too) -- Rik Lomas http://rikrikrik.com

[jQuery] Re: can you simplify this selector? easy for you...

2008-11-12 Thread Rik Lomas
Ah yeah, damn you :nth-child for being one-indexed 2008/11/12 Karl Swedberg [EMAIL PROTECTED]: On Nov 12, 2008, at 9:05 AM, Rik Lomas wrote: This is completely untested, but this is a bit simpler: $('#PG1_L03-table').find('td:eq(3), td:eq(5), td:eq(7),

[jQuery] Re: can you simplify this selector? easy for you...

2008-11-12 Thread Karl Swedberg
On Nov 12, 2008, at 11:13 AM, Rik Lomas wrote: Following on from Karl, how about: $('#PG1_L03-table td:nth-child(2n+3)').slice(0, 4).find('input') That won't work either, unless the table has only one row. Would have to do something like this instead: $('#PG1_L03-table

[jQuery] Re: can you simplify this selector? easy for you...

2008-11-12 Thread Rik Lomas
This is completely untested, but this is a bit simpler: $('#PG1_L03-table').find('td:eq(3), td:eq(5), td:eq(7), td:eq(9)').find('input').bind.. Rik 2008/11/12 ggerri [EMAIL PROTECTED]: Hi Gurus have the following selector and wonder how this could be simplified? :confused:

[jQuery] Re: can you simplify this selector? easy for you...

2008-11-12 Thread Rik Lomas
Haha, I'll give up trying to code on the fly and actually test my JS next time 2008/11/12 Karl Swedberg [EMAIL PROTECTED]: On Nov 12, 2008, at 11:13 AM, Rik Lomas wrote: Following on from Karl, how about: $('#PG1_L03-table td:nth-child(2n+3)').slice(0, 4).find('input') That won't work