HTML5 placeholder disappears on focus

前端 未结 6 867
广开言路
广开言路 2020-11-29 01:58

Is there a freely available jQuery plugin that changes placeholder behavior to match HTML5 spec?

Before Focus

6条回答
  •  庸人自扰
    2020-11-29 02:07

    Robert Nyman discusses the problem and documents his approach in his blog.
    This fiddle that has all the neccessary HTML, CSS and JS.

    enter image description here

    Unfortunately, he solves the problem by changing value.
    This will not work by definition if placeholder text is itself a valid input.

提交回复
热议问题