We often talk about onBlur events, onfocus events (js), and onbluronfocus events.
The onFocus event is an event that occurs when the cursor falls in the text box.
An onBlur event is an event that occurs when the cursor loses focus.
You can compile the following example:
1. html
<HTML> <HEAD> <TITLE> onBlur event handler </TITLE> </HEAD> <body bgcolor = "lavender"> <FORM name = "F1"> <INPUT TYPE = text NAME = text1 value = "1111ONBLUR_green" ONBLUR = "(document. bgColor = 'green') "> <input type = text NAME = text2 value =" 2222ONBLUR_black "ONBLUR =" (document. bgColor = 'black') "> <input type = text NAME = text2 value =" 3333ONBLUR_yellow "ONBLUR =" (document. bgColor = 'yellow') "> <br> <p> <input type = text NAME = text3 value =" 4444onfocus_blue "onfocus =" (document. bgColor = 'Blue ') "> <input type = text NAME = text4 value =" 5555onfocus_red "onfocus =" (document. bgColor = 'red') "> <input type = text NAME = text4 value =" 6666onfocus_orange "onfocus =" (document. bgColor = 'Orange ') "> </FORM> </BODY> </HTML>
Another example is as follows:
2. html
<! -- File Description: OnFocus event --> <! -- ---------------------------- --> <Html>
The previous article about the onBlur event and the onfocus event (js) are all the content that I have shared with you. I hope to give you a reference and support for the customer's house.