此页面 尚未准备好

注意: WebPlatform 项目在 2012 年至 2015 年间由多个维护者支持,现已停止维护。该网站现在可在 github 上找到。

placeholder

摘要

placeholder 属性指定输入字段的简短提示,描述预期的值(例如,示例值或预期格式的简短描述)。

适用范围 [HTMLInputElement](/html/elements/input)
在用户输入值之前,简短提示会显示在输入字段中。

示例

Address: <input type="text" name="address" placeholder="Insert here your address" />
Date of birth: <input type="text" name="day" placeholder="DD" />
<input type="text" name="month" placeholder="MM" />
<input type="text" name="year" placeholder="YYYY" />

备注

备注

placeholder 属性可用于文本或文本区域输入控件,或与基于文本的输入属性 URLemail 一起使用。以下示例显示了 URL 输入字段上的占位符文本。

语法

标准信息

参见

相关页面

署名