<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> 鼠标经过事件 </title>
<script type="text/javascript">
function message(){
var p=document.getElementById("pass");
if(p.value=="")
{
var que=document.getElementById("okk");
que.style.color="red";
if(confirm("请输入密码后,再单击确定!"))
{
p.focus();
}
esle
{
p.focus();
que.style.color="blue";
}
}
}
</script>
</head>
<body>
<form>
密码:<input name="password" id="pass" type="password" >
<input name="确定" id="okk" type="button" value="确定" onmouseover="message()"/>
</form>
</body>
</html>