Ale*_*lex 14 javascript jquery html5 placeholder
如何确定浏览器是否支持HTML5占位符标记,以便我可以决定是否挂钩我的jQuery占位符插件.
Jos*_*ber 17
var placeholderSupported = ( 'placeholder' in document.createElement('input') );
Run Code Online (Sandbox Code Playgroud)
该变量placeholderSupported
将true
是本机支持的.否则,它将被设置为false
.
thi*_*dot 16
http://diveinto.html5doctor.com/everything.html#placeholder
return 'placeholder' in document.createElement('input');
Run Code Online (Sandbox Code Playgroud)
但是,你正在使用的jQuery插件可能已经检查本机支持-你可能并不需要这个做自己.
归档时间: |
|
查看次数: |
5660 次 |
最近记录: |