HTML 5<input> placeholder属性

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

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

 

**placeholder属性适用于以下的<input>类型:text,search,url,telephone,email以及password.

 

<input placeholder="text">
<!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>

 

相关文章:

  • 2021-11-13
  • 2022-12-23
  • 2022-12-23
  • 2022-01-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-22
  • 2022-12-23
  • 2022-12-23
  • 2019-08-16
  • 2022-12-23
  • 2022-12-23
  • 2021-10-13
相关资源
相似解决方案