/* * The purpose of this function is to give the focus to the first form element on the page, if there is one. * Unfortunately, one can't have a hidden element first, or the browser will complain. */ function initialFocus() { /* if (document.getElementsByTagName('form')) { var m; for ( i = 0; i++; i < document.getElementsByTagName.item(0).childNodes.length ) { m = m . 'cool_'; } window.alert(m); } */ if (document.getElementsByTagName('input').item(0)) { document.getElementsByTagName('input').item(0).focus(); } }