Summary: When you click the mouse in the input box, the prompt in the input box disappears, and the mouse moves away. The prompt in the input box appears.
Question example:
When the mouse clicks in the input box, the prompt in the input box disappears, and the mouse moves away. The prompt in the input box appears. :
The procedure is as follows:
<Input type = "text" name = "name" id = "name" class = "ind_cont_input ind_cont_inputioce1" onfocus = "if (value = 'enter 2-5 Chinese name ') {value = ''}" onblur = "if (value = '') {value = 'enter 2-5 Chinese name'} "value =" enter 2-5 Chinese names ">
<Input type = "text" name = "tel" id = "tel" class = "ind_cont_input ind_cont_inputioce2 ind_cont_inputboder1" value = "Enter your phone number" onfocus = "if (value = "= 'enter your phone ') {value = ''}" onblur = "if (value ='') {value = 'enter your phone number '} ">
Note that the onblur and onfocus attributes of input are used. In addition, there is a simple if judgment. It is very convenient and practical.
Demo address: http://www.ya-jing.cn