HTML5 removes the need for JavaScript solutions. If a particular input should be “selected,” or focused, by default, we can now utilize the autofocus attribute.
That would make no sense at all. Only one item can have focus at a time. So either choose which item you want focus to fall on when the page loads, or don’t use the feature and let the user decide what to focus on.
Out of interest, I was wondering what browsers would do if you had autofocus on more than one input. Firefox chose the first one and ignored the second. Chrome ignored the first one and put focus on the second (more what I expected).