Hi André,

I am not sure if "autofocus" is supported right now.
But invoke focus() on an input element should work,

  var input = document.getElementById('input-id');
  input.focus();

If you cannot get it to work, please feel free to post your sample code
somewhere and/or open a bug on bugzilla.
(See inline comment on the code you posted.)

--
Thanks for your question.

Best regards,
Rudy, Mozilla Taiwan


On Thu, Jul 4, 2013 at 7:42 AM, Andre Mendes <an...@mendesc.com> wrote:

> Hello, I am trying to make my app focus on a input field when it finishes
> loading.
> I tried autofocus="true" as input parameter; didn't work
> Also tried $(document).ready(function(){ ('#my-input').focus(); });  didn't
>


Not sure if this is the actual code you are testing. If it is, does it need
a '$' or something to select the element?
 - e.g. $('#my-input').focus();

worked as well;
> As we are using angular too, I tried the angular equivalent of the above
> code, and it also failed.
>
> Is there any way to achieve it? Thanks in advance.
>
> --
>
> André Mendes
>  [image: Imagem inline 1]
>
> an...@intoo.com.br <art...@intoo.com.br>
> tel: +55 (11) 3255-7441 | cel: +55 (11) 953972772
>
> Praça Dom José Gaspar, 76, CJ 81
> CEP 01047-010 | São Paulo - SP | Brasil
> www.intoo.com.br
>
> _______________________________________________
> dev-b2g mailing list
> dev-b2g@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-b2g
>
_______________________________________________
dev-b2g mailing list
dev-b2g@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to