Placeholder VS Label for input in HTML5

后端 未结 3 848
无人共我
无人共我 2021-01-02 00:33

I\'m Making a form with multiple inputs where I need to give lable of form element inside input itself and I\'m using like this

An example

<

3条回答
  •  醉话见心
    2021-01-02 01:01

    Placeholder is no replacement for Label so I guess for screen reader this should be present or at least set the title attribute. Ref

    For cross browser compatibility you need to use javascript. Checkout http://www.hagenburger.net/BLOG/HTML5-Input-Placeholder-Fix-With-jQuery.html for that.

提交回复
热议问题