//电话号码中间4位隐藏
var tel = document.getElementById('dianhua').innerHTML;
var reg = /^(\d{3})\d{4}(\d{4})$/;
tels = tel.replace(reg, "$1****$2");
var tel = tels;
var tel = document.getElementById('dianhua').innerHTML;
var reg = /^(\d{3})\d{4}(\d{4})$/;
tels = tel.replace(reg, "$1****$2");
var tel = tels;
console.log(tel)
//手机号格式------------------ | |
var shoujihao = document.getElementById("shoujihao").innerHTML; | |
newShoujihao =shoujihao.replace(/(^\d{3}|\d{4}\B)/g,"$1-"); | |
document.getElementById("shoujihao").innerHTML = newShoujihao; |