---
title: "input提示"
author: "xdwangiflytek"
date: "2012-08-21T16:46:46Z"
tags: []
categories: ["Web前端"]
slug: "input"
draft: false
lastmod: "2012-08-21T16:46:46Z"
id: 1647676
url: "https://xdwangiflytek.iteye.com/blog/1647676"
---

效果图：

![](http://dl.iteye.com/upload/attachment/0072/6745/23952b83-a510-35de-a37f-90fb7eef4533.png)

代码：

```
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>input 提示</title>
</head>
<body>
<input type="text" style="color: rgb(153, 153, 153);" value="请输入用户名"
	onfocus="if(value=='请输入用户名') {value='';}this.style.color='#000';"
	onblur="if (value=='') {value='请输入用户名';this.style.color='#999';}">
</body>
</html>
```