Text in HTML Field to disappear when clicked?

后端 未结 7 619
悲&欢浪女
悲&欢浪女 2020-12-13 18:12

I can easily create a html input field that has text already in it. But when the user clicks on the input field the text doesn\'t disappears but stays there. The user then h

7条回答
  •  无人及你
    2020-12-13 18:52

    What you want to do is use the HTML5 attribute placeholder which lets you set a default value for your input box:

    This should achieve what you're looking for. However, be careful because the placeholder attribute is not supported in Internet Explorer 9 and earlier versions.

提交回复
热议问题