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
(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)