Code
<script>
function maskNum(tbID,index)
{
var tb = document.getElementById(tbID);
var nodes = tb.childNodes[0].childNodes; //得到tr
var telTb;
for(var i=0;i<nodes.length;i++)
{
try
{
telTb = nodes[i].cells[index];
var phone = telTb.innerText;
if(phone.indexOf('1')!=-1)
{
telTb.innerText = phone.substring(0,4)+'****'+phone.substring(8);
}
}
catch(e){continue;}
}
}
//maskNum('dgPhoneHandatilor',2);
maskNum('dgPhoneHandatilor',2);
maskNum('dgSpSend',1);
</script>
<script>
function maskNum(tbID,index)
{
var tb = document.getElementById(tbID);
var nodes = tb.childNodes[0].childNodes; //得到tr
var telTb;
for(var i=0;i<nodes.length;i++)
{
try
{
telTb = nodes[i].cells[index];
var phone = telTb.innerText;
if(phone.indexOf('1')!=-1)
{
telTb.innerText = phone.substring(0,4)+'****'+phone.substring(8);
}
}
catch(e){continue;}
}
}
//maskNum('dgPhoneHandatilor',2);
maskNum('dgPhoneHandatilor',2);
maskNum('dgSpSend',1);
</script>