为何IE9的placeholder不支持,长尾词为何旧版IE9不支持现代placeholder功能?

2026-04-06 11:301阅读0评论SEO资讯
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计123个文字,预计阅读时间需要1分钟。

为何IE9的placeholder不支持,长尾词为何旧版IE9不支持现代placeholder功能?

jQuery.placeholder.js 改写如下:

javascript(function($) { $.fn.placeholder=function(options) { var opts=$.extend({}, $.fn.placeholder.defaults, options); var isIE=document.all ? true : false; return this.each(function() { var _this=this; var placeholderValue=''; }); };})();

jquery.placeholder.js

(function($) { $.fn.placeholder = function(options) { var opts = $.extend({}, $.fn.placeholder.defaults, options) var isIE = document.all ? true : false return this.each(function() { var _this = this, placeholderValue = _this.getAttribute("placeholder"), typeValue = _this.getAttribute("type") if (isIE) { _this.setAttribute("type", "text") _this.setAttribute("value", placeholderValue) _this.onfocus = function() { if(typeValue == "password") _this.setAttribute("type", typeValue) if($.trim(_this.value) == placeholderValue) _this.value = "" } _this.onblur = function() { if($.trim(_this.value) == "") { _this.value = placeholderValue if(typeValue == "password") _this.setAttribute("type", "text") } } } }) } })(jQuery)

为何IE9的placeholder不支持,长尾词为何旧版IE9不支持现代placeholder功能?

本文共计123个文字,预计阅读时间需要1分钟。

为何IE9的placeholder不支持,长尾词为何旧版IE9不支持现代placeholder功能?

jQuery.placeholder.js 改写如下:

javascript(function($) { $.fn.placeholder=function(options) { var opts=$.extend({}, $.fn.placeholder.defaults, options); var isIE=document.all ? true : false; return this.each(function() { var _this=this; var placeholderValue=''; }); };})();

jquery.placeholder.js

(function($) { $.fn.placeholder = function(options) { var opts = $.extend({}, $.fn.placeholder.defaults, options) var isIE = document.all ? true : false return this.each(function() { var _this = this, placeholderValue = _this.getAttribute("placeholder"), typeValue = _this.getAttribute("type") if (isIE) { _this.setAttribute("type", "text") _this.setAttribute("value", placeholderValue) _this.onfocus = function() { if(typeValue == "password") _this.setAttribute("type", typeValue) if($.trim(_this.value) == placeholderValue) _this.value = "" } _this.onblur = function() { if($.trim(_this.value) == "") { _this.value = placeholderValue if(typeValue == "password") _this.setAttribute("type", "text") } } } }) } })(jQuery)

为何IE9的placeholder不支持,长尾词为何旧版IE9不支持现代placeholder功能?