建站资源下载详情
为您免费提供多种建站资源下载,包括网站模板下载、前端插件下载和字体下载!您只需注册为会员即可任意下载!

解决低版本浏览器对placeholder属性支持的JQuery插件placeholde.jquery.js

来源:易助科技网浏览量:12收藏

简介


JQuery占位符插件placeholders.jquery.js,placeholder这个属性在低版本的IE或者QQ浏览器等这些浏览器上这个属性不能生效,可以使用这个placeholder.js插件。

(附件中附有详细使用Demo)


解决低版本浏览器对placeholder属性支持的JQuery插件placeholde.jquery.js-示例图



使用


1.  引入  jquery.js   和 placeholders.jquery.js 文件


2.  调用


简单使用


$(function () {
  $('input,textarea').placeholder();
});


这将为Internet Explorer 7和8的文本输入和文本区域上的占位符属性提供故障切换


<input type="text" name="emailAddress" placeholder="Enter your email address" />
<textarea name="about" placeholder="Tell us about yourself" />

<script src="jquery-placeholder.js">
<script>
    $('input[type=text], textarea').placeholder();
</script>


此方法可用于为Internet Explorer 6添加故障转移


<input type="text" name="emailAddress" />
<input type="text" name="firstName" />
<input type="text" name="lastName" />

<script src="jquery-placeholder.js">
<script>
    $('input[name=emailAddress]').placeholder('Enter your email address');
    $('input[name=firstName]').placeholder('Enter your first name');
    $('input[name=lastName]').placeholder('Enter your last name');
</script>



相关链接


GitHub 地址 :  https://github.com/serby/jquery.placeholder.js