[jQuery] Re: Can't use selectors in reference to a named object?

2008-11-10 Thread Pete
zhaobing, you are a legend! I followed your example and modified my code as follows: $('form').each( function() { var thisForm = $(this); alert(thisForm.attr('id') + ' [' + $(':input.required', thisForm).length + '/' + $(':input', thisForm).length + ']'); }); On Nov 10, 1:13 pm

[jQuery] Re: Can't use selectors in reference to a named object?

2008-11-10 Thread 赵兵
try this:var f=$("form"); $("input,textarea",f).each(function(){ console.log($(this).attr("name")+'--'+$(this).val()); }); maybe this is what you want! On Mon, Nov 10, 2008 at 8:09 PM, Pete <[EMAIL PROTECTED]> wrote: > > The following doesn't work as expected and I don't understand why--can > s