1. implement automatic jump of text box focus and submit the form through the Enter key < ASP: textbox ID = "Passwd" Onkeydown = "If (event. keycode = 13) {document. All. imgbtnlogin. Focus (); event. keycode = 13; event. keycode = 13; return true ;}" Runat = "Server" Borderstyle = "Ridge" Textmode = "Password" > </ ASP: textbox >
In document. All. imgbtnlogin. Focus (); imgbtnlogin is the ID of the submit button
2. Get Page focusPage. registerstartupscript ("Getfocus","<SCRIPT> document. All ('"+Textbox1.clientid+"'). Focus (); </SCRIPT>");
Textbox1 is a web control, and textbox1.clientid is used to obtain the ID of the Web Control and send it to the client.
3. Clear cookies < Script Language = " Javascript " >
Function Clearbrowsedcookie ()
{
Document. Cookie= "Yourcookies=; Expires = Fri, 25-dec-1999 08:08:08 GMT; Path =/";
Document. getelementbyid ('browsedproductlist1 _ tabbrowsedproduct'). style. Display= "None";
}
</ Script >
Yourcookies are the names of the cookies you want to clear.
Call
< A Href = "Javascript: clearbrowsedcookie ();" > Clear cookie </ A >
4. Make the specified HTML domain invisible. The specified HTML domain is displayed after you click the specified link.
Example:
< Table ID = "Tab1" >
< Tr >
< TD >
Test
</ TD >
</ Tr >
</ Table >
< A Onclick = "Tabshow ();" Href = "#" >
< Script Language = " Javascript " >
Tab1.style. Display = " None " ;
Function Tabshow ()
{
If (Tab1.style. Display = " None " )
{
Tab1.style. Display="";
}
Else
{
Tab1.style. Display="None";
}
}
</ Script >
Function:
// ID of the tab table
Function Tabshow (Tab)
{
VaR Tabname = Document. getelementbyid (Tab );
If (Tabname. style. Display = " None " )
{
Tabname. style. Display="";
}
Else
{
Tabname. style. Display="None";
}
}
</ Script >