In IE 8 and earlier browsers, The placeholder attribute is not supported. ie8placeholder
The following code does not support the placeholder attribute in IE8 and earlier browsers.
Principle: Write the value of placeholder into the control as the content, and add the control event for simulation.
; (Function () {if (! ('Holder' in document. createElement ('input') {// match all input and textarea except type = password $ ('input [placeholder] [type! = Password], textarea [placeholder] '). each (function () {var self = $ (this), text = self. attr ('placeholder'); // if the content is empty, write if (self. val () = "") {self. val (text ). addClass ('holder');} // controls are activated to clear the placeholder self. focus (function () {if (self. val () = text) {self. val (""). removeClass ('placeholder ');} // The control loses focus and clears placeholder }). blur (function () {if (self. val () = "") {self. val (text ). addClass ('placeholder ');}});});}})();