Textarea click the mouse to clear the default word/click the text field to disappear by default/click the text box to delete the preset content.
Textarea click the mouse to clear default words click Text Field default content disappears click Text Box Delete preset content
There is a default text in the message box, search bar, or email subscription bar. For example, "Enter your content". If you click here (obtain the focus in the form ), the default text will automatically disappear.
Step 1:How to add code:
<Head>
....
<SCRIPT type = "text/JavaScript">
Function cleardefault (EL) {If (El. defaultvalue = El. Value) El. value = ""}
</SCRIPT>
...
</Head>
Step 2:In the input column, add an onfocus parameter, for example:
<Input type = "text" id = "input_email_address" name = "email" value = "your email address"Onfocus = "cleardefault (this )"/>
Step 3:For text fields, the onfocus parameter is added as follows:
<Textarea name = "comment" id = "input_comment" rows = "10 ″Onfocus = "This. value =''; this. onfocus = NULL ;"> Enter your content </textarea>
The above code is not added in the
**************************************** ***************************************
**************************************** **************************************** ***
Text Box text content disappears by default display Effect
Usually, the emphasis on text boxes is ignored. As a qualified artist, the whole page cannot be partially affected. Therefore, you must pay attention to the processing of every detail to make the page more perfect.
If the initial value is not empty:
<Textarea onmouseover = "javascript: If (this. value = 'move to the top of the text field and enter ') {This. value = ''; this. select ();} "Wrap = Virtual> move to the top of the text field to enter </textarea>
<Input type = "text" onmouseover = "javascript: If (this. value = 'move to the top of the text field and enter ') {This. value = ''; this. select ();} "value =" Move to the top of the text field to enter ">
If the initial value is empty, move the mouse away from the input text. When it is moved into the input box again, it will automatically select the previous text:
<Textarea class = "input" onmouseover = "This. Focus (); this. Select ()"> </textarea>
<Input name = "input" class = input onmouseover = This. Focus (); this. Select ()>
Move the text into the input box to disappear and show the text in the input box.
<Input type = "text" size = "18" value = "this is the default content" onfocus = "If (value = 'this is the default content ') {value = ''}" onblur = "If (value ='') {value = 'this is the default content'} ">