When the user enters the pwd password 123, the page jumps to the second page. After 4 seconds, the page automatically jumps to the third page.
Login.html
Copy codeThe Code is as follows:
<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8">
<Script type = "text/javascript">
// Check
Function check (){
// Window. alert ($ ("username"). value );
If ($ ("username"). value = "pwd" & $ ("pwd"). value = "123 "){
Return true;
} Else {
$ ("Username"). value = "";
$ ("Pwd"). value = "";
Return false;
}
}
// Obtain the Document Object
Function $ (id ){
Return document. getElementById (id );
}
</Script>
</Head>
<Body>
<Form action = "OK .html">
U: <input type = "text" id = "username"/> <br/>
P: <input type = "password" id = "pwd"/> <br/>
<Input type = "submit" value = "submit" onclick = "return check ()"/>
</Form>
</Body>
</Html>
OK .html
Copy codeThe Code is as follows:
<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8">
<Script type = "text/javascript">
// Jump to the specified page
Function tiao (){
ClearInterval (myInterval );
Window. open ("success.html", "_ self ");
}
// Set the jump in 5 seconds
SetTimeout ("tiao ()", 5000 );
// Change the number of seconds
Function changeSec (){
// Change the number
$ ("Myspan"). innerText = parseInt ($ ("myspan"). innerText)-1;
}
Var myInterval = setInterval ("changeSec ()", 1000 );
// Obtain the object
Function $ (id ){
Return document. getElementById (id );
}
</Script>
</Head>
<Body>
Log On <span id = "myspan"> 5 </span> seconds after successful logon.
</Body>
</Html>
Success.html
Copy codeThe Code is as follows:
<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8">
<Script type = "text/javascript">
</Script>
</Head>
<Body>
Welcome .......
</Body>
</Html>