document.getElementById(id).focus() is not working for firefox or chrome
<p>When ever I do onchange event, its going inside that function its validating, But focus is not comming I am using <code>document.getElementById('controlid').focus();</code></p>

<p>I am using Mozilla Firefox and Google Chrome, in both its not working. I don't want any IE. Can any one tell me what could me the reason.</p>

<p>Thanks in advance</p>

<p>Here's the code:</p>

<pre><code>var mnumber = document.getElementById('mobileno').value; 
if(mnumber.length &gt;=10) {
    alert("Mobile Number Should be in 10 digits only"); 
    document.getElementById('mobileno').value = ""; 
    document.getElementById('mobileno').focus(); 
    return false; 
}
</code></pre>
