Invoke the direct reference jquery with the following JS on the line, relative to most of the online example, this is a more perfect solution.
/** Ball to West Ravine * http://www.cnzj5u.com* 2014/11/26 12:12*/(function ($) { //determine if placeholder is supported functionIsplaceholer () {varinput = document.createelement ("Input"); return"Placeholder"inchinput; } varPlaceholderfriend ={focus:function(s) {s=$ (s). Hide (). Prev (). Show (). focus (); } } //Unsupported Code if(!Isplaceholer ()) { $(function () { varForm = $ ( This); varelements = Form.find ("Input[placeholder]"); Elements.each (function(i) {vars = $ ( This); varPValue = s.attr ("placeholder"); varsvalue =S.val (); if(pValue) {if(svalue = = "") { //DOM does not support type modification, you need to copy the Password box property, generate a new DOM varHTML = This. outerhtml | | ""; HTML=HTML. Replace (/\s*type= ([' "])? Password\1/gi," type=\ "text\" "). Replace (/\s*value= ([' "])? \s*\1?/gi," value=\ "" + PValue + "\" onfocus=\ "Phfrfocus (this); \" Style=\ "color: #a9a9a9; \" "); S.hide (); S.after (HTML); } } }); Elements.blur (function () { vars = $ ( This); varsvalue =S.val (); if(svalue = = ""{s.hide (). Next (). Show (); } }); }); } Window.phfrfocus=Placeholderfriend.focus;}) (jQuery);
Perfect for IE compatible with the jquery implementation of the input placeholder attribute