Comentário: Este artigo apresenta principalmente o atributo de espaço reservado para entrada HTML 5 para servir perfeitamente como IE. Amigos que precisam
Lembre -se de fazer referência à biblioteca de classes jQuery$ (document) .ready (function () {
if ($ .browser.msie)
$ ("Entrada: texto, entrada: senha"). cada (function () {
var $ espaço reservado = $ (this) .attr ("espaço reservado");
var $ width = $ (this) .css ("largura");
var $ id = $ (this) .attr ("id");
var $ altura = parseint ($ (this) .css ("altura")) + 6 + "px";
var $ fontsize = $ (this) .css ("font-size");
var $ fontweight = $ (this) .css ("font-weight");
var $ lineHeight = $ altura;
if ($ (this) .css ("altura da linha")! = "normal") {
$ lineHeight = parseInt ($ (this) .css ("line-hight")) + 6 + "px";
}
if ($ espaço reservado! = indefinido) {
$ (this) .After ("<span class =/" espaço reservado ph_ " + $ id +"/"style =/" width: " + $ width +"; line-hight: " + $ lineHeight +"; altura: " + $ altura +"; font-weight: " + $ fontweight"; margin-alginft:-" +"; + "</span>");
}
$ (this) .bind ("keyup", function () {
if ($ (this) .val () == "") {
$ (this) .parent (). encontre (".
}
outro {
$ (this) .parent (). encontre (". ph_" + $ id) .css ("display", "nenhum");
}
});
});
$ ("..
$ (this) .prev (). focus ();
});
});
Chamada de página
<input type = "text" placeholder = "Estou solicitando que o conteúdo seja normal" />
<input type = "text" placeholder = "Estou provocando a largura e a altura do conteúdo" />
<input type = "text" placeholder = "Estou solicitando conteúdo que tenho outros estilos" />
<input type = "text" placeholder = "você pode tentar outros" />
estilo
<style type = "text/css">
.placeholder {display: em linha-bloco; cor: cinza; alinhamento vertical: top; transbordamento: hidden;}
</style>