We often talk about onBlur events, onfocus events (js), and onbluronfocus events.

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.