实施例
raju327@gmail.com
9999888877
输出
rajuXXX@gmail.com
999XXXX877
而且核心我想使用按钮点击OTP密码修复OTP功能只有客户应该更改用户名和密码。
答案 0 :(得分:2)
检查工作示例,
$(document).ready(function () {
MobEncrypt();
EmailEncrypt()
});
function MobEncrypt() {
var value = '9999888877';
// make a string with x-characters
var x = new Array(value.length - 3).join('X');
// join this string with the tail of the value, and replace it
alert(x + value.substr(value.length - 3));
}
function EmailEncrypt() {
var value = 'raju327@gmail.com';
// make a string with x-characters
var x = new Array(value.length - 5).join('X');
// join this string with the tail of the value, and replace it
alert(x + value.substr(value.length - 5));
}

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
&#13;