John Resig schrieb:
> I'd try something like this:
> 
> $(function() {
>        var field = $("#second_field_to_enter")[0];
>        if ( field ) {
>            field.focus();
>        } else {
>            $("#first_field_to_enter")[0].focus();
>        }
> });
> 
> That might get you at your desired goal.
> 
> --John

Hey John, I thought you're guy writing the shortest JavaScript code in 
the world. What about:

$(function() {
     var field = $("#second_field_to_enter")[0] || 
$("#first_field_to_enter")[0].focus();
     field.focus();
});

;-)


-- Klaus

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to