It's wise to use autofocus with a JavaScript fallback for browsers that don't support it. From Mark Pilgrim's Dive into HTML5 Forms:
What’s that? You say you want your
autofocus fields to work in all
browsers, not just these fancy-pants
HTML5 browsers? You can keep your
current autofocus script. Just make
two small changes:
- Add the autofocus attribute to your HTML markup
- Detect whether the browser supports
the autofocus attribute, and only run
your own autofocus script if the
browser doesn’t support autofocus
natively.
<form name="f">
<input id="q" type="text" name="Gw" maxlength="225" size="42" autofocus>
<script>
if (!("autofocus" in document.createElement("input"))) {
document.getElementById("q").focus();
}
</script>
<input type="submit" value="Go">
</form>
Live demo here.