<!DOCTYPE html>
<html>
<head>
<title>MyHtml.html</title>
<style type = css/text>
input{
border:1px solid #999;
}
</style>
</head>
<body>
<form method = "get" action = "">
<p>
uersname:<input type = "text" name = "username" style = "color:#999" value = "请输入关键字"
onfocus = "if(this.value=='请输入关键字'){this.value='';this.style.color = '#424242'}"
onblur = "if(this.value==''){this.value='请输入关键字';this.style.color = '#999'}">
</p>
<p>
password:<input type = "password" name = "password"><!-- 有name后端数据提交成功 -->
</p>
<input type = "submit" value = "提交">
</form>
</body>
</html>
光标移动出text显示出请输入,移动至text可以输入