JS-MD5加密

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>提交表单</title>
<script src="http://cdn.bootcss.com/blueimp-md5/2.10.0/js/md5.min.js"></script>
</head>
<body>

<form action="#" method="post">
<p><span>用户:</span><input type="text" id="username" name="username"></p>
<p><span>密码:</span><input type="password" id="password" name="password"></p>
<!--绑定事件onclick 点击事件-->
<button type="submit" onclick="aaa()">提交</button>
</form>


<script>
function aaa() {
var usn = document.getElementById('username');
var psw = document.getElementById('password');
console.log(usn.value);
console.log(psw.value);
psw.value = md5(psw.value);
console.log(psw.value);
}
</script>
</body>
</html>
posted @ 2021-10-20 15:47  吴大叔  阅读(2264)  评论(0编辑  收藏  举报