The onfocus event is the event that occurs when the cursor falls in a text box.
The onblur event is the event that occurs when the cursor loses focus.
The following examples can be compiled
1.html
<HTML>
<HEAD>
<TITLE> using onblur event handler </TITLE>
</HEAD>
<body Bgcolor= "Lavender" >
<form name= "F1" > <input type=text name=text1 "value="
Onblur= "(document.bgcolor= ' green ')" >
<input type=text name=text2 value= "2222onblur_black" ( 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>
There are also the following examples
2.html
<!--file Description: onfocus Event-->
<!---------------------------------->
The above cliché onblur events and onfocus events (JS) is a small series to share all the content, hope to give you a reference, but also hope that we support the cloud habitat community.