> Or you could call focus on each of the elements in the jQuery object like
> this:
> 
> jQuery.fn.fieldFocus = function() {
>     return this.each(function() {
>         if (this.focus) this.focus();
>     });
> };
> 
> Inside of the each method the 'this' points to the actual DOM element
> and not the jQuery object. I check for focus first so as not to cause
> an error on elements that don't have the method.

While that is true, it doesn't make sense in this specific example. There can't 
be more element then one with focus...

--
Jörn Zaefferer

http://bassistance.de
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to