Textarea的占位符没有出现

时间:2022-09-10 20:29:05

I have no clue why the placeholder is not showing up in the textarea:

我不知道为什么占位符没有出现在textarea中:

<textarea id="message" tabindex="4" cols="39" name="message" rows="7" 
    placeholder="Your Message"></textarea>
<input id="sendto" name="sendto" type="hidden" 
    value="benjamin@example.com" />

1 个解决方案

#1


I dont know if this will be helpful, but:

我不知道这是否有用,但是:

Here is the documentatcion from W3C and information that placeholder is valid for both: textarea, and input.

以下是来自W3C的文档以及占位符对以下内容有效的信息:textarea和input。

In that case if Your browser does not show it and everything is done as it should (html5 doctype, and good html structure of whole file), then it is nothing to worry about. Maybe this is some kind of bug, or temporary problem, or something else.

在这种情况下,如果您的浏览器没有显示它并且一切都按照它应该完成(html5 doctype,以及整个文件的良好html结构),那么就没什么好担心的了。也许这是某种错误,或临时问题,或其他。

IMPORTANT! Remember to add label to each input or textarea (as stated in documentary file), and then placeholder is kind of additional convenience.

重要!请记住为每个输入或textarea添加标签(如文档文件中所述),然后占位符是一种额外的便利。

#1


I dont know if this will be helpful, but:

我不知道这是否有用,但是:

Here is the documentatcion from W3C and information that placeholder is valid for both: textarea, and input.

以下是来自W3C的文档以及占位符对以下内容有效的信息:textarea和input。

In that case if Your browser does not show it and everything is done as it should (html5 doctype, and good html structure of whole file), then it is nothing to worry about. Maybe this is some kind of bug, or temporary problem, or something else.

在这种情况下,如果您的浏览器没有显示它并且一切都按照它应该完成(html5 doctype,以及整个文件的良好html结构),那么就没什么好担心的了。也许这是某种错误,或临时问题,或其他。

IMPORTANT! Remember to add label to each input or textarea (as stated in documentary file), and then placeholder is kind of additional convenience.

重要!请记住为每个输入或textarea添加标签(如文档文件中所述),然后占位符是一种额外的便利。