Article introduction of Wulin.com (www.vevb.com): Web skills: The usage of the focus of the form (textarea).
A complete collection of usage of the form (textarea)1. The text box displays the default text:
1
2
<textarea>Webpage Teaching Network-webjx.com</textarea>
<textarea>Webpage Teaching Network-webjx.com</textarea>
2. Click the text box with the mouse, and the default text disappears:
1
2
<textarea onfocus=if(value== 'Webwebjx.com ') {value=''}>Webwebjx.com</textarea>
<textarea onfocus=if(value== 'Webwebjx.com ') {value=''}>Webwebjx.com</textarea>
3. Move the mouse to the text box, and the default text disappears:
1
2
<textarea onmouseover=focus() onfocus=if(value== 'Webjx.com ') {value=''}>Webjx.com-webjx.com</textarea>
<textarea onmouseover=focus() onfocus=if(value== 'Webjx.com ') {value=''}>Webjx.com-webjx.com</textarea>
4. Click the text box with the mouse, the default text disappears, click any area outside the text box, and the default text reappears again:
1
2
<textarea onfocus=if(value== 'Webjx.com ') {value=''} onblur=if(value=='') {value= 'Webjx.com '}>Webjx.com '}>Webjx.com '}
<textarea onfocus=if(value== 'Webjx.com ') {value=''} onblur=if(value=='') {value= 'Webjx.com '}>Webjx.com '}>Webjx.com '}
5. Move the mouse to the text box, the default text disappears, the mouse to move out of the text box, and the default text reappears:
1
2
<textarea onmouseover=focus() onmouseout=blur() onfocus=if(value== 'WebJx.com ') {value=''} onblur=if (value=='') {value= 'WebJx.com '}>WebJx.com '}>WebJx.com</textarea>
<textarea onmouseover=focus() onmouseout=blur() onfocus=if(value== 'WebJx.com ') {value=''} onblur=if (value=='') {value= 'WebJx.com '}>WebJx.com '}>WebJx.com</textarea>
6. Click the text box with the mouse, and any text in the text box disappears (including the default text and the text entered later):
1
2
<textarea onclick=value=''>Webpage Teaching Network-webjx.com</textarea>
<textarea onclick=value=''>Webpage Teaching Network-webjx.com</textarea>
7. Move the mouse to the text box, and any text in the text box disappears (including the default text and the text entered later):
1
2
<textarea onmouseover=value=''>Webpage Teaching Network-webjx.com</textarea>
<textarea onmouseover=value=''>Webpage Teaching Network-webjx.com</textarea>
8. Click the text box and select all the text in the text box:
1
2
<textarea onfocus=select()>Webpage Teaching Network-webjx.com</textarea>
<textarea onfocus=select()>Webpage Teaching Network-webjx.com</textarea>
9. Move the mouse to the text box and select all text in the text box:
1
2
<textarea onmouseover=focus() onfocus=select()>Webpage Teaching Network-webjx.com</textarea>
<textarea onmouseover=focus() onfocus=select()>Webpage Teaching Network-webjx.com</textarea>
10. After entering, the focus will be transferred from the current text box to the next text box:
1
2
<textarea onkeydown=if(event.keyCode==13)event.keyCode=9>Webpage Teaching Network-webjx.com</textarea>
<textarea onkeydown=if(event.keyCode==13)event.keyCode=9>Webpage Teaching Network-webjx.com</textarea>
11. After entering, the focus will be transferred from the current text box to the specified position:
1
<textarea onkeypress=return focusNext(this, 'id name of the specified location', event)>Webjx.com</textarea>