div block-level elements get focus

Source: Internet
Author: User

Need to get lost focus on Div when doing popup layer

Focus Blur is only for form form controls, and for spans, Div, Li, and so on, there's no way to trigger their actions.
Several events (from the press release). Blur event: The Blur event occurs when the element loses focus. Focus Event: The focus () method is used to give the text field focus (and also to let some elements get focus events). TabIndex Property: The TabIndex property sets or returns the tab control order of the button. We all know that Blur is only for form controls, and for spans, Div, Li and the like, there is no way to trigger their actions, and now we just need to set a TabIndex property to trigger their focus event.



Objects with a positive value of TabIndex are selected based on the ascending value order and the order of the positions in the code
An TabIndex value of 0 is selected based on the order of the positions in the code
Objects with a negative value of tabindex are ignored

div block-level elements get focus

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.