HTML input field hint

后端 未结 9 1534
轻奢々
轻奢々 2021-01-01 09:23

I want to provide the user with a hint on what he needs to enter into my text field. However, when I set the value, it does not disappear once a user clicks on the text fiel

9条回答
  •  没有蜡笔的小新
    2021-01-01 09:40

    With a bit of JavaScript:

    
    

    HTML5 has a nice attribute for this, called placeholder:

    
    

    but this attribute is not supported in old browsers.

提交回复
热议问题