This article to share is a very common and practical tips, when the mouse clicks into the input box (input), the input box prompts disappear, the mouse again moved, input box prompts appear, recommended to the small partners
Questions like title:
The mouse clicks to the input box (input), the input box prompts disappears, the mouse moves away again, the input box prompts appears. As shown in the figure:
The procedure is as follows:
The code is as follows:
<input type= "text" name= "name" id= "name" class= "Ind_cont_input Ind_cont_inputioce1" onfocus= "if (value = = ' Please input 2-5 Chinese name ') {value = '} ' onblur= ' if (value = = ') {value= ' Please enter 2-5 Chinese name '} ' value= "Please enter 2-5 Chinese names" >
<input type= "Text" name= "Tel" id= "tel" class= "ind_cont_input" Ind_cont_inputioce2 ind_cont_inputboder1 "value=" Please enter your phone "onfocus=" if (value = = ' Please enter your phone ') {value = '} ' onblur= ' if (value = = ') {value= ' Please enter your phone '} ' >
Note that the point is the onblur and onfocus attribute of input. There are also simple if judgments. It's very convenient and practical.
The above is the full content of this article, I hope you can enjoy.