Directly on the code, you need to introduce Jquery
$ (function () {///The browser does not support placeholder if (! (') Placeholder ' in document.createelement (' Input '))} {$ (' [placeholder] '). each (function () {var $tag = $ (t His); Current input var $copy = $tag. Clone (); The copy of the current input $copy. CSS ("Color", "#999"); $copy. Val ($copy. attr (' placeholder ')); $copy. focus (function () {if (This.value = = $copy. attr (' placeholder ')) {this.value = " ; This.style.color = ' #000 '; } }); $copy. blur (function () {if (this.value== "") {this.value = $copy. attr (' placeholder '); $tag. Val (""); This.style.color = ' #999 '; } else {$tag. val (this.value); } }); $tag. Hide (). After ($copy. Show ()); Current input hidden, with placeholder function JS input display}); }});
IE10 The following versions perfectly support placeholder features