if your iframe has an src attribute with the same domain as the parent document, then it is simple:
<iframe src=" ... " onload="document.getElementById('foo').focus();"></iframe>
, " ":
1. iframe ( , javascript), , ( : http://softwareas.com/cross-domain-communication-with-iframes)
2. 3- - iframe,
( dns + document.domain , )