The div in the HTML gets the focus, removing the border when the input div gets the focus

Source: Internet
Author: User

Tested only if IE Chrome has a border when it gets focus

Using CSS

Div {    outline:none;}
Div Focus Event--"Focus and TabIndex"?

Excerpt from: http://my.oschina.net/jgy/blog/131970

Add tabindex= '-1 ' property;

Default: Get no Focus event (Blur)

<class= "Wl-product"  ID= "Wl-product"></  div>

Can get focus event (Blur)

<class= "Wl-product"  ID= "Wl-product"  TabIndex= '-1 '></div>

First look at the section on onfocus:
The onfocus event occurs when a element receives focus either by the pointing device or by tabbing navigation.
This attribute is used with the following elements:a, area, LABEL, INPUT, SELECT, TEXTAREA, and BUTTON.
The onfocus event is triggered when the element receives focus by specifying (clicking) or tab navigation (tabbing navigation).
The attribute is used in the following element (that is, the element that can get the focus by default): A, area, LABEL, INPUT, SELECT, TEXTAREA, and BUTTON.

Div, frameSet, span, table, TD. Only set Tableindex to get focus, but

IE default to get focus but not tab navigation

Different tabindex values in the tab order (tabbing navigation):
Objects with a positive tabIndex is selected in increasing IIndex order and in source order to resolve duplicates.
Objects with an tabIndex of zero is selected in source order.
Objects with a negative tabIndex is omitted from the tabbing order.
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

The div in the HTML gets the focus, removing the border when the input div gets the 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.