<p>Using jquery how do I focus the first element (edit field, text area, dropdown field, etc)
in the form when the page load?</p>

<p>Something like:</p>

<pre><code>document.forms[0].elements[0].focus();
</code></pre>

<p>but using jquery.</p>

<p>Another requirement, don't focus the first element when the form has class="filter".</p>

```
```
$('form:not(.filter) :input:visible:enabled:first').focus()
```
```
This will select the first visible input element (
```
<input />
```
,
```
<select>
```
,
```
<textarea>
```
) that doesn't have the class
```
filter
```
in it.