如何设置文本框内的默认文字?
效果如图:
下面是源代码。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>placeholder属性</title>
</head>
<body>
<input type="text" placeholder="点击搜索" />
</body>
</html>
单行文本框
语法:
<input type="text" />
placeholder属性
设置文本框内默认文字
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>placeholder属性</title>
</head>
<body>
<input type="text" placeholder="在这里设置默认文字" />
</body>
</html>