我怎样才能使输入框中有那些在框中输入内容就会消失的灰色文本呢?
例如:当你想问一个问题时,在“Title”输入框中有这样一个问题:“Is a R function for index the index element in a vector.”。
发布于 2021-08-18 10:48:46
你要找的东西叫做placeholder。下面是一个示例:
<input type="text" placeholder="Type something here">
下面是textarea的另一个示例
<textarea rows="4" cols="50" placeholder="Describe yourself here..."></textarea>
发布于 2021-08-18 10:49:07
这种模糊的文本被称为占位符。
您可以使用'placeholder'属性将其放在您自己的文本字段中。
<input type="text" placeholder="This is first name" />https://stackoverflow.com/questions/68830862
复制相似问题