Enter the setting and clearing of "prompt text" in the text box, and empty the text box.
<1>
<Html xmlns = "http://www.w3.org/1999/xhtml">
In the input text box in html, there is a text prompt in the beginning. When you click it, the text disappears. How can I set it?
Use the onfocus event to check the current value. If it is the default value, leave the value Attribute blank. For example:
<Input type = "text" value = "Enter the content" onfocus = "javascript: if (this. value = 'Enter the content') this. value = '';">
I have already provided the implementation method of the placeholder attribute of html5. what I have provided is the JS solution.
Set prompt text settings in the vb text box
Private Sub Form_Load ()
Text1.Text = "Enter your information! "
End Sub
Private Sub text=click ()
Text1.Text = ""
End Sub
If the number of controls in your form is large, and the text box control is not the first time to get the focus, you can also do this!
Private Sub text=gotfocus ()
Text1.Text = ""
End Sub