On Nov 30, 2007, at 12:48 AM, Dan M wrote:


Karl,

Thanks for taking the time to help!

Should I be able to apply the hide method from there???

$('input:not(:checkbox)').prev('label').hide('slow');

Yes, absolutely.

Of course, you need to bind it to an event of some sort, too, or at least put it inside document ready.

$(document).ready(function() {
  $('input:not(:checkbox)').prev('label').hide('slow');
});




On Nov 29, 10:45 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote:
On Nov 29, 2007, at 8:00 PM, Dan M wrote:



All,

I don't know if this is the correct place to post this but here
goes...

I have form with many elements (textboxes, selects, textareas and
such). Each element has a label just before it. I'm trying to select
all of the labels in the form EXCEPT those that precede a checkbox.

Thanks in advance for any help.

Dan

Hi Dan,

You could start with the inputs and remove the checkboxes, and finally
find all previous labels:

   $('input:not(:checkbox)').prev('label');

Or you could do it with a filter function:

  $('label').filter(function() {
    return !$(this).next(':checkbox').length;
  });

--Karl
_________________
Karl Swedbergwww.englishrules.comwww.learningjquery.com

Reply via email to