For future reference, I have to include the HTML5 way to do this.
(为了将来参考,我必须包含HTML5方法来执行此操作。)
<input name="Email" type="text" id="Email" value="[email protected]" placeholder="What's your programming question ? be specific." />
If you have a HTML5 doctype and a HTML5-compliant browser, this will work.
(如果您有HTML5文档类型和HTML5兼容的浏览器,这将有效。)
However, many browsers do not currently support this , so at least Internet Explorer users will not be able to see your placeholder.(但是, 许多浏览器目前不支持此功能 ,因此至少Internet Explorer用户将无法看到您的占位符。)
However, see http://www.kamikazemusic.com/quick-tips/jquery-html5-placeholder-fix/ ( archive.org version ) for a solution.(但是,请参阅http://www.kamikazemusic.com/quick-tips/jquery-html5-placeholder-fix/(archive.org 版本 )以获取解决方案。)
Using that, you'll be very modern and standards-compliant, while also providing the functionality to most users.(使用它,您将非常现代且符合标准,同时还为大多数用户提供功能。)
Also, the provided link is a well-tested and well-developed solution, which should work out of the box.
(此外,提供的链接是经过充分测试和完善的解决方案,应该开箱即用。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…