JS方法1: $("#tel").html($("#tel").substring(0,3)+"***"+$("#tel").substring(8,11));
JS方法1:var tel = document.getElementById('tel'),
telVal = tel.innerText;
var newTelVal = '';
if(telVal.length > 0){
for(var i = 0; i < telVal.length; i++){
if(i < 3 || i >= telVal.length-3){
newTelVal += telVal[i];
}else{
newTelVal += '';
}
}
}
tel.innerText = newTelVal;