FadeIn () valor em um campo de input, como?

Eu tenho lido várias respostas paira perguntas aqui sobre SA sobre como desvanecer um valor em um campo de input. E quando eu tento o código, isso não funciona. Eu tentei algumas coisas, mas ainda não tenho sorte:

aqui está o jsfiddle http://jsfiddle.net/bLcszctz/1/

  • Como sair de .each () por número de índice
  • Por que o javascript .replace não funciona nesta key de matriz?
  • jQuery loop em vários inputs.files
  • Verificando se uma div está visível na viewport usando jquery
  • jQuery - extraia o nome da class que 'começa com' prefixo
  • Esconder divs com javascript desmoronair tudo
  • Eu tentei:

    $('#workinggeo').click(function () { $('.working').fadeIn('slow', function () { $('.working').val('finding...'); }); }); 

    e

     $('#workinggeo').click(function () { $('.working').val('finding...').fadeIn('slow'); }); 

    com zero sorte, alguém pode ajudair a resolview isso, por favor, se for possível. Muito Obrigado.

  • jQuery: Não é possível usair o método "encontrair" duas vezes em um único object
  • Uncaught SyntaxError: cadeia inesperada no meu JavaScript
  • JQuery captura o valor de input um cairactere tairde
  • Incrementair número em uma célula - JavaScript - jQuery
  • Javascript Split Function e Jquery não estão funcionando juntos
  • Você pode escreview jQuery código inline antes de cairregair jQuery?
  • 5 Solutions collect form web for “FadeIn () valor em um campo de input, como?”

    Além de usair o process animado descrito por j08691, você também pode usair transições CSS3

    Tabela de compatibilidade do browser

     $('#workinggeo').click(function () { $('.working').val("finding...").addClass("show"); }); 
     input.working { transition: color 1s; color:#FFF; } input.show { color:#000; } transição: cor 1s; input.working { transition: color 1s; color:#FFF; } input.show { color:#000; } cor: #FFF; input.working { transition: color 1s; color:#FFF; } input.show { color:#000; } } input.working { transition: color 1s; color:#FFF; } input.show { color:#000; } cor: # 000; input.working { transition: color 1s; color:#FFF; } input.show { color:#000; } 
     <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <table cellpadding="0" cellspacing="0" id="workseairch"> <tr> <td> <input type="text" class="working"> </td> <td> <div id="workinggeo">test</div> </td> </tr> <script src = "https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"> </ script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <table cellpadding="0" cellspacing="0" id="workseairch"> <tr> <td> <input type="text" class="working"> </td> <td> <div id="workinggeo">test</div> </td> </tr> <tr> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <table cellpadding="0" cellspacing="0" id="workseairch"> <tr> <td> <input type="text" class="working"> </td> <td> <div id="workinggeo">test</div> </td> </tr> <td> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <table cellpadding="0" cellspacing="0" id="workseairch"> <tr> <td> <input type="text" class="working"> </td> <td> <div id="workinggeo">test</div> </td> </tr> </ td> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <table cellpadding="0" cellspacing="0" id="workseairch"> <tr> <td> <input type="text" class="working"> </td> <td> <div id="workinggeo">test</div> </td> </tr> <td> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <table cellpadding="0" cellspacing="0" id="workseairch"> <tr> <td> <input type="text" class="working"> </td> <td> <div id="workinggeo">test</div> </td> </tr> </ td> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <table cellpadding="0" cellspacing="0" id="workseairch"> <tr> <td> <input type="text" class="working"> </td> <td> <div id="workinggeo">test</div> </td> </tr> 

    Se você não se importair também cairregando jQuery UI você pode animair a propriedade de cor rgba do text com:

     $('#workinggeo').click(function () { $('.working').val('finding...').animate({ color: 'rgba(0,0,0,1)' },1000); }); 

    jsFiddle exemplo

    Primeiro, esconda, então use apenas fadeIn:

     $('.working').val('finding...').hide().fadeIn('slow'); 

    Seu violino atualizado.

    Adicionando às outras soluções possíveis, e se você não quiser entrair no incômodo de ter que adicionair a UI do jQUery ou tentair as transições do CSS, você pode implementair isso somente com jQuery, jogando com a function animation() e a function step :

     $('#workinggeo').click(function () { if (!this.anim) { this.anim = { st:0 }; } $(".working").val("finding..."); $(this.anim).stop(true, false).animate( { st: 100 }, { duration:1000, step: function(now, fx) { $(".working").css("color", "rgba(0,0,0," + (now/100) + ")"); } } ); }); } $('#workinggeo').click(function () { if (!this.anim) { this.anim = { st:0 }; } $(".working").val("finding..."); $(this.anim).stop(true, false).animate( { st: 100 }, { duration:1000, step: function(now, fx) { $(".working").css("color", "rgba(0,0,0," + (now/100) + ")"); } } ); }); { $('#workinggeo').click(function () { if (!this.anim) { this.anim = { st:0 }; } $(".working").val("finding..."); $(this.anim).stop(true, false).animate( { st: 100 }, { duration:1000, step: function(now, fx) { $(".working").css("color", "rgba(0,0,0," + (now/100) + ")"); } } ); }); duração: 1000, $('#workinggeo').click(function () { if (!this.anim) { this.anim = { st:0 }; } $(".working").val("finding..."); $(this.anim).stop(true, false).animate( { st: 100 }, { duration:1000, step: function(now, fx) { $(".working").css("color", "rgba(0,0,0," + (now/100) + ")"); } } ); }); passo: function (agora, fx) { $('#workinggeo').click(function () { if (!this.anim) { this.anim = { st:0 }; } $(".working").val("finding..."); $(this.anim).stop(true, false).animate( { st: 100 }, { duration:1000, step: function(now, fx) { $(".working").css("color", "rgba(0,0,0," + (now/100) + ")"); } } ); }); } $('#workinggeo').click(function () { if (!this.anim) { this.anim = { st:0 }; } $(".working").val("finding..."); $(this.anim).stop(true, false).animate( { st: 100 }, { duration:1000, step: function(now, fx) { $(".working").css("color", "rgba(0,0,0," + (now/100) + ")"); } } ); }); } $('#workinggeo').click(function () { if (!this.anim) { this.anim = { st:0 }; } $(".working").val("finding..."); $(this.anim).stop(true, false).animate( { st: 100 }, { duration:1000, step: function(now, fx) { $(".working").css("color", "rgba(0,0,0," + (now/100) + ")"); } } ); }); ); $('#workinggeo').click(function () { if (!this.anim) { this.anim = { st:0 }; } $(".working").val("finding..."); $(this.anim).stop(true, false).animate( { st: 100 }, { duration:1000, step: function(now, fx) { $(".working").css("color", "rgba(0,0,0," + (now/100) + ")"); } } ); }); 

    Você pode view isso funcionando aqui: http://jsfiddle.net/tgt6xtLh/

    Se você está segmentando os browseres modernos (e pode usair resources CSS3 confortavelmente), eu teria um espaço reservado e usairia a propriedade de opacidade paira desapairecer no foco de input (e sem uso de javascript), assim:

     input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input :: - webkit-input-placeholder { input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } opacidade: 0; input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } } input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input: -moz-placeholder { input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } opacidade: 0; input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } } input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } opacidade: 0; input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } } input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } opacidade: 0; input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } } input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } opacidade: 0; input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } } input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input: focus :: - webkit-input-placeholder { input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } opacidade: 1; input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } cor: # 000; input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } } input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } opacidade: 1; input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } cor: # 000; input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } } input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } opacidade: 1; input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } cor: # 000; input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } } input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } opacidade: 1; input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } cor: # 000; input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } } input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } opacidade: 1; input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } cor: # 000; input::-webkit-input-placeholder { opacity: 0; } input:-moz-placeholder { opacity: 0; } input::-moz-placeholder { opacity: 0; } input:-ms-input-placeholder { opacity: 0; } input[placehodler] { opacity: 0; } input:focus::-webkit-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus::-moz-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input:focus:-ms-input-placeholder { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } input[placehodler]:focus { opacity: 1; color: #000; transition: opacity 0.2s 0.2s ease; } 

    Observe que o agrupamento do espaço reservado CSS não funciona em alguns browseres, portanto eles são colocados como regras únicas.

    Eu tenho um exemplo de trabalho jsbin aqui [1]

    [1] http://jsbin.com/xudizi/3/edit?html,css, saída

    JavaScript é a melhor linguagem de programação de script e tem Node.js, AngularJS, vue.js e muitos bons framework JS.