1、用字符串截断和拼接的方法:
$("#tel").html($("#tel").substring(0,3)+"****"+$("#tel").substring(8,11));2、用正则表达式:
phone = phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
$("#tel").html($("#tel").substring(0,3)+"****"+$("#tel").substring(8,11));2、用正则表达式:
phone = phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');