2014-11-22 35 views

回答

0

您應該可以使用HTML placeholder屬性來執行此操作。

HTML

<input type="password" name="fname" placeholder="password"> 

ASP

<asp:textbox placeholder="password" runat="server" /> 

對於IE版本10之前,你需要use a placeholder polyfill得到充分的支持。

+1

如果您需要考慮舊版瀏覽器,請查看佔位符polyfills http://stackoverflow.com/questions/15436125/the-best-placeholder-polyfil-script-for-ie7-ie8-and-ie9 – 2014-11-22 10:24:05

+0

感謝您的工作罰款爲鉻和Firefox,但對於IE我不得不添加此... https://github.com/UmbraEngineering/Placeholder – MTplus 2014-11-22 10:38:05

+0

如果這項工作適合你,接受答案 – ashkufaraz 2014-11-22 17:33:23

相關問題