<!DOCTYPE HTML>
<html>
<body>

<form action="/example/html5/demo_form.asp" method="get">
<input type="search" name="user_search" placeholder="Search W3School" />
<input type="submit" />
</form>

</body>
</html>

定义和用法

placeholder 属性提供可描述输入字段预期值的提示信息(hint)。

该提示会在输入字段为空时显示,并会在字段获得焦点时消失。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-11
  • 2021-12-03
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-07
  • 2021-11-21
  • 2021-10-18
  • 2022-01-16
相关资源
相似解决方案