Re: Quick questions -- how do I place the cursor (i.e., set focus) to a field on page load?
| From: | mike | Date: | Wed, 14 Nov 2007 01:49:13 +0000 |
| Subject: | Re: Quick questions -- how do I place the cursor (i.e., set focus) to a field on page load? | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-264464@lists.php.net to get a copy of this message | ||
yeah, but adding in jquery will open up his entire world :)
the example below will work without jquery. personally though i try to
stick with jquery since i usually need it for more throughout my site.
On 11/13/07, Chris <dmagick@gmail.com> wrote:
> It only works if you have included the jquery javascript files.
>
> If you don't want to use that you could do something like:
>
> <script defer>
> document.getElementById('username').focus();
> </script>