I tried to use focus for first input field on the form. but it doesn\'t work. When I call attr(\"id\") for that input it worked. When I call focus f
focus
attr(\"id\")
Try the first selector,
$("form input:first").focus();
http://jsfiddle.net/erick/mMuFc/