function login(){ var username = $("#username").val(); var userpass = $("#userpass").val(); if(userpass=='' || username==''){ alert('请填写用户名和密码'); return false; } }