JavaScript form focus, does my code look okay?
<p>This morning I asked a pretty mundane question about my JS syntax, and someone suggested I use their code instead, so I went ahead with it because I know virtually Zero about JS.</p>

<p>Using my moderate PHP knowledge, I made a slight modification adding a second ID with an <code>'else if'</code> statement (see below) and was just wondering if you folks who know more about JavaScript could tell me if it all looks good?</p>

<p>Or maybe you would do it differently altogether?</p>

<pre><code>window.onload = formfocus;

function formfocus()
{
    var id_one;
    var id_two;

    id_one = document.getElementById( 'author' );
    id_two = document.getElementById( 's_primary' );

    if ( id_one )
    {
     id_one.focus();
     id_one.value = '';
    }
    else if ( id_two )
    {
     id_two.focus();
     id_two.value = '';
    }
}
</code></pre>

<p>EDIT: I am slightly concerned about my <code>window.onload = formfocus();</code> ... but not really sure if there is any other way to accomplish what I want.</p>
