First look at an htmCodeIt contains a disabled text box, a common writeable text box, and a button. The Code is as follows:
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Title> </title>
</Head>
<Body>
Disabled input: <input type = "text" id = "B1" value = "asldfjasldfa" Disabled = "disabled"> </input> <br/>
Non-disabled input: <input type = "text" id = "B2" value = "asldfjasldfa"> </input>
<Input type = "button" id = "butt1" name = "butt" value = "close" onclick = "window. Close ()"/>
</Body>
</Html>
The running page is as follows:
The actual test shows that, in ie9, once the mouse enters the disabled text box, for example, dragging the mouse inside and selecting some content, and then trying to move the mouse away, for example, moving it to the second text box, for example, if you click the close button below, you will find that you cannot do it. It seems that the focus of the disabled text box can never be left, and other text boxes or buttons will never get the focus unless you use the tab key to switch, or simply switch to another software interface and then turn back, then other controls can be clicked.
This problem was not found in IE6, 7, 8, and 10.
After consultation, I learned that this is indeed a bug in ie9.
How can this problem be solved? Below are some of the methods we have explored:
1. Upgrade to ie10.
The upgrade to ie10 naturally solves this problem. Since ie10 has solved this problem, ie9 should not fix this bug with patches.Program.
2. Double-click the other part of the page to remove the focus from the disabled text box.
3. writing a script to disable disabled text box selection is also a method, but the premise is that since the text box has been disabled, it will not accept any JS events, so this action can only be performed on its parent element, for example, bind a JS event to another plug-in outside the disabled text box to prohibit the mouse from entering or selecting this area, the disabled text box cannot be selected, so the problem that the focus of the text box cannot be left does not exist.
I wonder if you have encountered this problem and have any better solutions?