Full-stack JavaScript path (15th) HTML5 focus extension (focus extension), html5
HTML5 adds the focus management function. The focus of documents can be obtained through page loading, user input (usually by pressing the tab key), and the focus () function is called in the code.
The attributes and methods of the auxiliary management focus added by HTML5 include:
Document. activeElement attribute. This attribute points to the element that obtains the focus. The value during document loading is null. The document is loaded completely and saved as a reference to document. body.
Document. hasFocus () method to determine whether the document gets the focus.
The most important use of these two functions is to improve the accessibility of Web applications. A major sign of accessibility Web applications is the proper focus management, and it is a great progress to know which element has obtained the focus. We don't have to rely on speculation as we used.
Browsers that implement these two attributes include IE 4 +, Firefox 3 +, Safari 4 +, Chrome and Opera 8 +.
In html5 and button tags, the autofocus attribute automatically obtains the focus. What does it mean? You can see the difference by opening the following content in a browser that supports html5. After the page is loaded, click a space to directly click the button. Similar to <input type = 'text' autofocus/>, when a page is loaded, the cursor is automatically focused on this text box.
<Button autofocus> bbb </button>
<Button> aaa </button>
After HTML5 extensions are installed, why can't I use the server DW CS5 javascript code to prompt extensions? I don't know what version of DW you are using
DW CS5 itself supports HTML5 jQuery extension. The greennet version is available for download on CSDN. NET.