How do I auto-hide placeholder text upon focus using css or jquery?

后端 未结 26 1763
长情又很酷
长情又很酷 2020-11-28 00:39

This is done automatically for every browser except Chrome.

I\'m guessing I have to specifically target Chrome.

Any solutio

26条回答
  •  感情败类
    2020-11-28 01:05

    Here is a CSS-only solution (for now, only works in WebKit):

    input:focus::-webkit-input-placeholder {
        opacity: 0;
    }
    

提交回复
热议问题