Copy codeThe Code is as follows:
Var Page_INIT = function (){
$ (Document). bind ("mouseover", function (e) {// move the mouse over
If (e.tar get. tagName. toUpperCase () = "INPUT "){
Var input = e.tar get;
If (input. type = "text") {// if it is a text box
If (window. Page_FocusTimer) {// if it is in the focus state
Window. clearTimeout (window. page_focustout); // clear the focus status
}
Window. page_focustout = window. setTimeout (function () {// this anonymous method is executed every 0.2 seconds.
If (! Input. value) {// if the content is empty, set it to focus
Try {
Input. focus ();
} Catch (e ){}
}
},200 );
}
}
}). Bind ("mouseout", function (e) {// move the mouse out
If (e.tar get. tagName. toUpperCase () = "INPUT") {// The Name Of The Event source object to be processed (that is, the HTML Tag) is converted to uppercase.
Var input = e.tar get;
If (input. type = "text "){
If (window. page_focust ){
Window. clearTimeout (window. page_focustout );
}
}
}
});
}