JavaScript實現(xiàn)自動跳轉(zhuǎn)文本功能
更新時間:2017年05月25日 15:59:20 作者:且聽風吟leo
這篇文章主要為大家詳細介紹了JavaScript自動跳轉(zhuǎn)文本功能,具有一定的參考價值,感興趣的小伙伴們可以參考一下
貼一段自動跳轉(zhuǎn)文本的代碼實現(xiàn):
實現(xiàn)代碼:
<html>
<head>
<title>文本跳轉(zhuǎn)</title>
<style type=text/css>
body{
MARGIN-TOP: 10px;
FONT-SIZE: 10pt;
MARGIN-LEFT: 10px;
MARGIN-RIGHT: 0px;
FONT-FAMILY: "微軟雅黑"
}
</style>
<meta http-equiv=Content-Type content="text/html; charset=gb2312">
</head>
<body>
<script type="text/javascript">
function InBox1() {
if(document.code.Box1.value.length == 4) {
document.code.Box2.focus();
}
}
function InBox2() {
if(document.code.Box2.value.length == 4) {
document.code.Box3.focus();
}
}
function InBox3() {
if(document.code.Box3.value.length == 4) {
document.code.Box4.focus();
}
}
</script>
<formname="code" action="" method="post">輸入:
<input maxLength="4" size="4" name="Box1" onkeyup="return InBox1()">-
<input maxLength="4" size="4" name="Box2" onKeyUp="return InBox2()">-
<input maxLength="4" size="4" name="Box3" onKeyUp="return InBox3()">-
<input maxLength="4" size="4" name="Box4">
</form>
</body>
</html>
以上就是本文的全部內(nèi)容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。
您可能感興趣的文章:
- 百度判斷手機終端并自動跳轉(zhuǎn)js代碼及使用實例
- js監(jiān)聽鼠標點擊和鍵盤點擊事件并自動跳轉(zhuǎn)頁面
- javascript秒數(shù)倒計時自動跳轉(zhuǎn)代碼
- JavaScript實現(xiàn)x秒后自動跳轉(zhuǎn)到一個頁面
- JSP中的倒數(shù)計時和自動跳轉(zhuǎn)頁面
- 網(wǎng)站頁面自動跳轉(zhuǎn)實現(xiàn)方法PHP、JSP(上)
- wap瀏覽自動跳轉(zhuǎn)到wap頁面的js代碼
- 等待指定時間后自動跳轉(zhuǎn)或關閉當前頁面的js代碼
- 網(wǎng)站頁面自動跳轉(zhuǎn)實現(xiàn)方法PHP、JSP(下)
- JavaScript實現(xiàn)頁面5秒后自動跳轉(zhuǎn)的方法
相關文章
javaScript實現(xiàn)網(wǎng)頁版的彈球游戲
這篇文章主要為大家詳細介紹了javaScript實現(xiàn)網(wǎng)頁版的彈球游戲,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下2021-07-07

