input輸入密碼變黑點密文的實現(xiàn)方法
更新時間:2017年01月09日 11:52:46 作者:小碼農(nóng)雯
本文主要介紹了Jquery Easyui驗證擴展,Easyui驗證,Easyui校驗,js正則表達式。具有一定的參考價值,下面跟著小編一起來看下吧
input輸入密碼加密
html代碼
<form id="login-form" method="post" onsubmit="return checkForm()"> 輸入密碼<input type="password" id="input-password"> <input type="hidden" id="md5-password" name="password"> <button type="submit">Submit</button> </form>
js代碼
function checkForm() {
var input_pwd = document.getElementById('input-password');
var md5_pwd = document.getElementById('md5-password');
// 把用戶輸入的明文變?yōu)镸D5:
md5_pwd.value = toMD5(input_pwd.value);
// 繼續(xù)下一步:
return true;
}
以上就是本文的全部內(nèi)容,希望本文的內(nèi)容對大家的學(xué)習(xí)或者工作能帶來一定的幫助,同時也希望多多支持腳本之家!
相關(guān)文章
JS實現(xiàn)鼠標(biāo)點擊箭頭旋轉(zhuǎn)180度功能
這篇文章主要介紹了JS實現(xiàn)鼠標(biāo)點擊箭頭旋轉(zhuǎn)180度的效果,通過點擊三角按鈕旋轉(zhuǎn)180度,本文通過實例代碼給大家介紹的非常詳細,需要的朋友參考下吧2024-02-02

