2014-11-22 58 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