輸入賬號密碼后跳轉到另外一個網頁,但不和后端鏈接,只是簡單的點擊登錄按鈕就跳轉,那直接用border裝飾a標簽做一個登錄按鈕可以嗎?還能怎么做?
uj5u.com熱心網友回復:
直接給按鈕加上a標簽即可,還可以使用js對賬號密碼進行簡單的判斷,例如:賬號密碼不輸入即跳轉不過去,更高級一點,可以給按鈕加上一個單擊事件,實作跳轉
uj5u.com熱心網友回復:
<input type="password" id="pass" />
<a href="https://wwww.baidu.com" id="go">跳轉</a>
<script type="text/javascript">
document.getElementById("go").onclick = function () {
var pass = document.getElementById("pass").value;
if (pass=="1234") {
return true;
} else {
alert("密碼錯誤");
return false;
}
}
</script>
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/120759.html
標籤:HTML(CSS)
上一篇:jsp在線聊天室
下一篇:leaflet如何加載shp檔案
