jsp 动态网页制作问题(急急·~)

来源:百度知道 编辑:UC知道 时间:2024/06/16 19:12:17
<script language=javascript>
function SetFocus()
{
if (document.Login.account.value=="")
document.Login.account.focus();
else
document.Login.account.select();
}
function CheckForm()
{
if(document.Login.account.value=="")
{
alert("请输入登录帐号!");
document.Login.account.focus();
return false;
}
if(document.Login.password.value == "")
{
alert("请输入登录密码!");
document.Login.password.focus();
return false;
}
}
</script>

其中function SetFocus()
{
if (document.Login.account.value=="")
document.Login.account.focus();
else
document.Login.account.select();
} 这是什么意思???????高手请回答~~~

如果登录帐号还没填,就把光标移到那个input text
如果已经填了,就选中内容

目的就是为了让你填帐号的时候省点事,如果之前已经填了不用手动去选中,

这样直接输入就可以了