How do I get form values to disappear when I enter the field?

后端 未结 5 1605
名媛妹妹
名媛妹妹 2021-02-08 21:39

I am making a simple form with about eight input fields. I want the initial value in the field to indicate what people are supposed to enter. For example value=\"name\" so that

5条回答
  •  有刺的猬
    2021-02-08 22:30

    Set the 'default' value to "Name". Then, using javascript and the 'onfocus' event, clear the field.

    So you would have:

    
    

提交回复
热议问题