In some Web pages or the use of the pop-up layer, the general situation in IE browser we do not want to use the tab or say
When you use the TAB key, you can create problems, such as:
After the pop-up layer, the TAB key can also be manipulated in the page, which results in a script error.
So what if we avoid this?
Controlling by keyboard events
Copy Code code as follows:
<script language= "javascript" type= "Text/javascript" src= ". /javascript/jquery-1.2.6.min.js "></script>
<script language=" javascript "type=" Text/javascript ">
$ (document). Ready (function () {
$ (document). Bind (' KeyDown ', function (event) {
if (Event.keycode = 9) {
Document.body.focus ();
}
});
});
</script>
The above code is very familiar is to press the TAB key when the focus moved again to the top of the TabIndex 0
Then we need to set the initialization page focus at the beginning of the page.
For example, the following example is written in aspx:
<box:button id= "btnclose" text= "Off" runat= "server" systemicon= "close" tabindex= "0" focusonpageload= "true" >
</box:Button>
In some special cases we need to set the focus position when the page is loaded in order to prevent the TabIndex setting from appearing invalid or affected by other factors.
So that you can be foolproof!