简单的登录提示
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>登录页</title>
<script type="text/javascript">
function psw(el) {
if (el.value == '输入密码') {
el.value = '';
el.type = 'password';
}
}
function txt(el) {
if (!el.value) {
el.type = 'text';
el.value = '输入密码';
}
}
</script>
</head>
<body>
<form id=-"mainForm">
<input type="text" value="用户名" onfocus="if (value =='用户名'){value =''}" onblur="if (value ==''){value='用户名'}" />
<input type="text" value="输入密码" onfocus="psw(this)" onblur="txt(this)"/>
<input type="submit" class="login_btn" id="login_btn" value="提交" />
</form>
</body>
</html>