Take the 2-minute tour ×  This is a sample of my form. when the
page loads the focus must be on 'fbox' but it dosent work and i
don understand why. the form contains a niceditor but i dont
think that is the problem  <body
onload="document.form.fbox.focus();"> <form method='post'
action='' name='form' > Headline <input name='fbox' type='text'
class='form' id='box' autocomplete='off' size='80'><br> Your
text</font><br><script type="text/javascript"
src="nicEdit.js"></script><script
type="text/javascript">bkLib.onDomLoaded(function() {
nicEditors.allTextAreas() });</script> <textarea
name="description" style="width: 100%;
height:200px;"></textarea></p>      <p><select name='catg' >
<option value='' selected >Select category</option> <input
type="submit" id='button' name="Submit" value="Submit"
class="button"></form>   share|improve this question It is
working in chrome, BTW you do know you have to accept answers??
see stackoverflow.com/faq#howtoask –  Trufa Apr 14 '11 at 14:51
Give document.forms[0].fbox.focus()