function check() { var a = document.getElementsByTagName('form')[0].getElementsByName('n1')[0]; if(idTimer)clearTimeout(idTimer) if( a.value.length == 0 ) idTimer = setTimeout( function check() {a.focus()},10); }