Dave,

Actually, I tried both of those things first - should have mentioned
that.  It was only after I got three elements doing
alert($j(".is_preferred_email")) that I switched to using the index.

On Oct 5, 7:53 pm, Dave Methvin <[EMAIL PROTECTED]> wrote:
> >         $j(".is_preferred_email").each(
> >             function(i) {
> >                 this[i].checked = false;
> >             }
> >         );
>
> Inside the function of each(), the first arg is the index in the
> array. The "this" is the actual DOM element. It looks like you thought
> it was the original jQuery object, but it's not. In short, what you
> wanted was this.checked and not this[i].checked.
>
> However, you could have just said:
>
> $j(".is_preferred_email").attr("checked", false);
>
> which is a lot shorter! There is an internal .each() built into nearly
> all the setter functions like .attr(), .css(), and .bind() so it is
> automatically applied to all the elements that were selected.

Reply via email to