function chk(){ if(document.getElementById("username").value==""){ alert("用户名没有填写!"); document.getElementById("username").focus(); return false; } if(document.getElementById("password").value==""){ alert("密码没有填写!"); document.getElementById("password").focus(); return false; } } document.writeln(""); document.writeln("
"); document.writeln("
"); document.writeln("用户名: "); document.writeln("  密码: "); document.writeln(" "); document.writeln(" "); document.writeln("  注册"); document.writeln("
"); document.writeln("
");