设计input搜索框提示文字点击消失的效果

来源:互联网 发布:360通用php防护代码 编辑:程序博客网 时间:2024/05/13 15:07
 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>input索引提示特效</title>
</head>

<body>
<table>
<tr>
 <td><input value="提示的文字" onfocus="if (value =='提示的文字'){value =''}" onblur="if (value ==''){value='提示的文字'}" /></td>
</tr>
</table>
</body>
</html>