电话号码中间****代替
<div id="phone">1888888888</div> <script type="text/javascript"> // 产品展示 fcncpzs(); $(function() { var phone = $('#phone').text(); var nPhone = phone.substr(0, 3) + '****' + phone.substring(7, 11) $('#phone').text(nPhone); }); </script>
效果:188****8888