document.getFirst('input, select, textarea')

The difference is that you're applying getFirst to an Elements collection.
This way,
the selector is used as a match check, so the first element that matches
input, select, textarea
will be returned.

See the *walk* function for further details.

On Sat, Sep 20, 2008 at 5:51 PM, kesmit <[EMAIL PROTECTED]> wrote:

>
> I'm trying to figure out a way to find the first visible form input
> element (i.e., input[type!='hidden'], select, textarea) in a page.
> The simplest way I could think of doing this would be to do $$
> ('input[type!='hidden'], select, textarea').getFirst(), but the $$
> function seems to look for all of the input elements first, then the
> select elements, and finally the textarea elements.  I know about the
> compareDocumentPosition DOM method, but it looks like it isn't
> supported well in all browsers.  Is there a way to get the first form
> input element?
>
> Kevin D Smith
>



-- 
Guillermo Rauch
http://devthought.com

Reply via email to